Errors: Convert errors to JS objects.
For CLI format as JSON with indent = 2.