Simpler error return for non text/html
This commit is contained in:
@@ -1,7 +1,6 @@
|
|||||||
package handlers
|
package handlers
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
|
||||||
"embed"
|
"embed"
|
||||||
"fmt"
|
"fmt"
|
||||||
"html/template"
|
"html/template"
|
||||||
@@ -26,7 +25,7 @@ func RenderErrorPage() fiber.Handler {
|
|||||||
tmpl.Execute(c.Response().BodyWriter(), err.Error())
|
tmpl.Execute(c.Response().BodyWriter(), err.Error())
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
return c.SendStream(bytes.NewBufferString(err.Error()))
|
return c.SendString(err.Error())
|
||||||
}
|
}
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user