Skip to content

Commit f44b1fd

Browse files
committed
Update version
1 parent 64d74e8 commit f44b1fd

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

app.go

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import (
2626
)
2727

2828
// Version of current package
29-
const Version = "1.10.4"
29+
const Version = "1.10.5"
3030

3131
// Map is a shortcut for map[string]interface{}, useful for JSON returns
3232
type Map map[string]interface{}
@@ -49,6 +49,14 @@ type App struct {
4949

5050
// Settings holds is a struct holding the server settings
5151
type Settings struct {
52+
// Possible feature for v1.11.x
53+
// // ErrorHandler is executed when you pass an error in the Next(err) method
54+
// // This function is also executed when a panic occurs somewhere in the stack
55+
// // Default: func(err error, ctx *fiber.Ctx) {
56+
// // ctx.Status(500).Send(err.Error())
57+
// // }
58+
// ErrorHandler func(*Ctx, error)
59+
5260
// Enables the "Server: value" HTTP header.
5361
// Default: ""
5462
ServerHeader string
@@ -181,6 +189,10 @@ func New(settings ...*Settings) *App {
181189
Prefork: utils.GetArgument("-prefork"),
182190
BodyLimit: 4 * 1024 * 1024,
183191
Concurrency: 256 * 1024,
192+
// Possible feature for v1.11.x
193+
// ErrorHandler: func(ctx *Ctx, err error) {
194+
// ctx.Status(500).SendString(err.Error())
195+
// },
184196
},
185197
}
186198
// Overwrite settings if provided
@@ -200,6 +212,12 @@ func New(settings ...*Settings) *App {
200212
getBytes = getBytesImmutable
201213
getString = getStringImmutable
202214
}
215+
// Possible feature for v1.11.x
216+
// if app.Settings.ErrorHandler == nil {
217+
// app.Settings.ErrorHandler = func(ctx *Ctx, err error) {
218+
// ctx.Status(500).SendString(err.Error())
219+
// }
220+
// }
203221
}
204222
// Initialize app
205223
return app.init()
@@ -491,6 +509,10 @@ func (app *App) init() *App {
491509
Logger: &disableLogger{},
492510
LogAllErrors: false,
493511
ErrorHandler: func(fctx *fasthttp.RequestCtx, err error) {
512+
// Possible feature for v1.11.x
513+
// ctx := app.AcquireCtx(fctx)
514+
// app.Settings.ErrorHandler(ctx, err)
515+
// app.ReleaseCtx(ctx)
494516
if _, ok := err.(*fasthttp.ErrSmallBuffer); ok {
495517
fctx.Response.SetStatusCode(StatusRequestHeaderFieldsTooLarge)
496518
fctx.Response.SetBodyString("Request Header Fields Too Large")

0 commit comments

Comments
 (0)