@@ -25,7 +25,7 @@ func TestErrorHandling(t *testing.T) {
25
25
26
26
httpServer := echo .New ()
27
27
httpServer .Logger = httpserver .NewEchoLogger (logger )
28
- httpServer .HTTPErrorHandler = httpserver .JsonErrorHandler (false , false )
28
+ httpServer .HTTPErrorHandler = httpserver .NewJsonErrorHandler (false , false ). Handle ( )
29
29
30
30
httpServer .GET ("/test" , func (c echo.Context ) error {
31
31
return fmt .Errorf ("custom error" )
@@ -57,7 +57,7 @@ func TestErrorHandlingWithObfuscate(t *testing.T) {
57
57
58
58
httpServer := echo .New ()
59
59
httpServer .Logger = httpserver .NewEchoLogger (logger )
60
- httpServer .HTTPErrorHandler = httpserver .JsonErrorHandler (true , false )
60
+ httpServer .HTTPErrorHandler = httpserver .NewJsonErrorHandler (true , false ). Handle ( )
61
61
62
62
httpServer .GET ("/test" , func (c echo.Context ) error {
63
63
return fmt .Errorf ("custom error" )
@@ -89,7 +89,7 @@ func TestErrorHandlingWithStack(t *testing.T) {
89
89
90
90
httpServer := echo .New ()
91
91
httpServer .Logger = httpserver .NewEchoLogger (logger )
92
- httpServer .HTTPErrorHandler = httpserver .JsonErrorHandler (false , true )
92
+ httpServer .HTTPErrorHandler = httpserver .NewJsonErrorHandler (false , true ). Handle ( )
93
93
94
94
httpServer .GET ("/test" , func (c echo.Context ) error {
95
95
return fmt .Errorf ("custom error" )
@@ -123,7 +123,7 @@ func TestErrorHandlingWithObfuscateAndStack(t *testing.T) {
123
123
124
124
httpServer := echo .New ()
125
125
httpServer .Logger = httpserver .NewEchoLogger (logger )
126
- httpServer .HTTPErrorHandler = httpserver .JsonErrorHandler (true , true )
126
+ httpServer .HTTPErrorHandler = httpserver .NewJsonErrorHandler (true , true ). Handle ( )
127
127
128
128
httpServer .GET ("/test" , func (c echo.Context ) error {
129
129
return fmt .Errorf ("custom error" )
@@ -157,7 +157,7 @@ func TestErrorHandlingWithHeadRequest(t *testing.T) {
157
157
158
158
httpServer := echo .New ()
159
159
httpServer .Logger = httpserver .NewEchoLogger (logger )
160
- httpServer .HTTPErrorHandler = httpserver .JsonErrorHandler (false , false )
160
+ httpServer .HTTPErrorHandler = httpserver .NewJsonErrorHandler (false , false ). Handle ( )
161
161
162
162
httpServer .HEAD ("/test" , func (c echo.Context ) error {
163
163
return fmt .Errorf ("custom error" )
@@ -189,7 +189,7 @@ func TestErrorHandlingWithAlreadyCommittedResponse(t *testing.T) {
189
189
190
190
httpServer := echo .New ()
191
191
httpServer .Logger = httpserver .NewEchoLogger (logger )
192
- httpServer .HTTPErrorHandler = httpserver .JsonErrorHandler (false , false )
192
+ httpServer .HTTPErrorHandler = httpserver .NewJsonErrorHandler (false , false ). Handle ( )
193
193
194
194
httpServer .GET ("/test" , func (c echo.Context ) error {
195
195
err := fmt .Errorf ("custom error" )
@@ -224,7 +224,7 @@ func TestErrorHandlingWithHttpError(t *testing.T) {
224
224
225
225
httpServer := echo .New ()
226
226
httpServer .Logger = httpserver .NewEchoLogger (logger )
227
- httpServer .HTTPErrorHandler = httpserver .JsonErrorHandler (false , false )
227
+ httpServer .HTTPErrorHandler = httpserver .NewJsonErrorHandler (false , false ). Handle ( )
228
228
229
229
httpServer .GET ("/test" , func (c echo.Context ) error {
230
230
return echo .NewHTTPError (http .StatusBadRequest , "bad request error" )
@@ -256,7 +256,7 @@ func TestErrorHandlingWithWrappedError(t *testing.T) {
256
256
257
257
httpServer := echo .New ()
258
258
httpServer .Logger = httpserver .NewEchoLogger (logger )
259
- httpServer .HTTPErrorHandler = httpserver .JsonErrorHandler (false , false )
259
+ httpServer .HTTPErrorHandler = httpserver .NewJsonErrorHandler (false , false ). Handle ( )
260
260
261
261
httpServer .GET ("/test" , func (c echo.Context ) error {
262
262
return echo .NewHTTPError (http .StatusBadRequest , fmt .Errorf ("wrapped error" ))
@@ -288,7 +288,7 @@ func TestErrorHandlingWithWrappedErrorWithStack(t *testing.T) {
288
288
289
289
httpServer := echo .New ()
290
290
httpServer .Logger = httpserver .NewEchoLogger (logger )
291
- httpServer .HTTPErrorHandler = httpserver .JsonErrorHandler (false , true )
291
+ httpServer .HTTPErrorHandler = httpserver .NewJsonErrorHandler (false , true ). Handle ( )
292
292
293
293
httpServer .GET ("/test" , func (c echo.Context ) error {
294
294
return echo .NewHTTPError (http .StatusBadRequest , fmt .Errorf ("wrapped error" ))
@@ -322,7 +322,7 @@ func TestErrorHandlingWithWrappedErrorWithObfuscateAndStack(t *testing.T) {
322
322
323
323
httpServer := echo .New ()
324
324
httpServer .Logger = httpserver .NewEchoLogger (logger )
325
- httpServer .HTTPErrorHandler = httpserver .JsonErrorHandler (true , true )
325
+ httpServer .HTTPErrorHandler = httpserver .NewJsonErrorHandler (true , true ). Handle ( )
326
326
327
327
httpServer .GET ("/test" , func (c echo.Context ) error {
328
328
return echo .NewHTTPError (http .StatusBadRequest , fmt .Errorf ("wrapped error" ))
@@ -356,7 +356,7 @@ func TestErrorHandlingWithHttpErrorWithStack(t *testing.T) {
356
356
357
357
httpServer := echo .New ()
358
358
httpServer .Logger = httpserver .NewEchoLogger (logger )
359
- httpServer .HTTPErrorHandler = httpserver .JsonErrorHandler (false , true )
359
+ httpServer .HTTPErrorHandler = httpserver .NewJsonErrorHandler (false , true ). Handle ( )
360
360
361
361
httpServer .GET ("/test" , func (c echo.Context ) error {
362
362
return echo .NewHTTPError (http .StatusBadRequest , "bad request error" )
@@ -390,7 +390,7 @@ func TestErrorHandlingWithHttpErrorWithObfuscateAndStack(t *testing.T) {
390
390
391
391
httpServer := echo .New ()
392
392
httpServer .Logger = httpserver .NewEchoLogger (logger )
393
- httpServer .HTTPErrorHandler = httpserver .JsonErrorHandler (true , true )
393
+ httpServer .HTTPErrorHandler = httpserver .NewJsonErrorHandler (true , true ). Handle ( )
394
394
395
395
httpServer .GET ("/test" , func (c echo.Context ) error {
396
396
return echo .NewHTTPError (http .StatusBadRequest , "bad request error" )
@@ -424,7 +424,7 @@ func TestErrorHandlingWithInternalHttpError(t *testing.T) {
424
424
425
425
httpServer := echo .New ()
426
426
httpServer .Logger = httpserver .NewEchoLogger (logger )
427
- httpServer .HTTPErrorHandler = httpserver .JsonErrorHandler (false , false )
427
+ httpServer .HTTPErrorHandler = httpserver .NewJsonErrorHandler (false , false ). Handle ( )
428
428
429
429
httpServer .GET ("/test" , func (c echo.Context ) error {
430
430
internalError := echo .NewHTTPError (http .StatusInternalServerError , "internal error" )
@@ -462,7 +462,7 @@ func TestErrorHandlingWithInternalHttpErrorWithStack(t *testing.T) {
462
462
463
463
httpServer := echo .New ()
464
464
httpServer .Logger = httpserver .NewEchoLogger (logger )
465
- httpServer .HTTPErrorHandler = httpserver .JsonErrorHandler (false , true )
465
+ httpServer .HTTPErrorHandler = httpserver .NewJsonErrorHandler (false , true ). Handle ( )
466
466
467
467
httpServer .GET ("/test" , func (c echo.Context ) error {
468
468
internalError := echo .NewHTTPError (http .StatusInternalServerError , "internal error" )
@@ -502,7 +502,7 @@ func TestErrorHandlingWithInternalHttpErrorWithObfuscateAndStack(t *testing.T) {
502
502
503
503
httpServer := echo .New ()
504
504
httpServer .Logger = httpserver .NewEchoLogger (logger )
505
- httpServer .HTTPErrorHandler = httpserver .JsonErrorHandler (true , true )
505
+ httpServer .HTTPErrorHandler = httpserver .NewJsonErrorHandler (true , true ). Handle ( )
506
506
507
507
httpServer .GET ("/test" , func (c echo.Context ) error {
508
508
internalError := echo .NewHTTPError (http .StatusInternalServerError , "internal error" )
0 commit comments