add as_json to custom exception class