@@ -129,7 +129,12 @@ macro error_json(*args)
129129 error_json_helper(env, {{* args}})
130130end
131131
132- def error_json_helper (env : HTTP ::Server ::Context , status_code : Int32 , exception : Exception , additional_fields : Hash (String , Object ) | Nil )
132+ def error_json_helper (
133+ env : HTTP ::Server ::Context ,
134+ status_code : Int32 ,
135+ exception : Exception ,
136+ additional_fields : Hash (String , Object ) | Nil = nil
137+ )
133138 if exception.is_a?(InfoException )
134139 return error_json_helper(env, status_code, exception.message || " " , additional_fields)
135140 end
@@ -146,11 +151,12 @@ def error_json_helper(env : HTTP::Server::Context, status_code : Int32, exceptio
146151 return error_message.to_json
147152end
148153
149- def error_json_helper (env : HTTP ::Server ::Context , status_code : Int32 , exception : Exception )
150- return error_json_helper(env, status_code, exception, nil )
151- end
152-
153- def error_json_helper (env : HTTP ::Server ::Context , status_code : Int32 , message : String , additional_fields : Hash (String , Object ) | Nil )
154+ def error_json_helper (
155+ env : HTTP ::Server ::Context ,
156+ status_code : Int32 ,
157+ message : String ,
158+ additional_fields : Hash (String , Object ) | Nil = nil
159+ )
154160 env.response.content_type = " application/json"
155161 env.response.status_code = status_code
156162
@@ -163,10 +169,6 @@ def error_json_helper(env : HTTP::Server::Context, status_code : Int32, message
163169 return error_message.to_json
164170end
165171
166- def error_json_helper (env : HTTP ::Server ::Context , status_code : Int32 , message : String )
167- error_json_helper(env, status_code, message, nil )
168- end
169-
170172# -------------------
171173# Redirect
172174# -------------------
0 commit comments