The purpose of the Failure is to represent an Error or an Exception as plain object for easy conversion to JSON.
The Exception class can simply implement the toJSON() method for JSON conversions. But it's not possible for built-in errors.
I wonder if some workaround is possible, so the Failure type can be removed.
The purpose of the
Failureis to represent anErroror anExceptionas plain object for easy conversion to JSON.The
Exceptionclass can simply implement thetoJSON()method for JSON conversions. But it's not possible for built-in errors.I wonder if some workaround is possible, so the
Failuretype can be removed.