public toMap() as SortedMap<String, Object>:
Converts this failure to its JSON-compatible representation.
A map accepted by JSON.stringify.
JSON.stringify
data = failure.toMap() print(data["errorType"])