We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e5bf7d5 commit dea2febCopy full SHA for dea2feb
src/Exception/General.php
@@ -217,12 +217,26 @@ public static function csrf($error = null)
217
(new \Leaf\Http\Response())->exit(
218
static::errorMarkup(
219
'Invalid request',
220
- "<p>$error</p>" ?? '<p>The page you are looking for has expired.</p>'
+ $error ? "<p>$error</p>" : '<p>The page you are looking for has expired.</p>'
221
),
222
400
223
);
224
}
225
226
+ /**
227
+ * Generic error page
228
+ */
229
+ public static function error($title, $message, $code = 500)
230
+ {
231
+ (new \Leaf\Http\Response())->exit(
232
+ static::errorMarkup(
233
+ $title,
234
+ "<p>$message</p>"
235
+ ),
236
+ $code
237
+ );
238
+ }
239
+
240
/**
241
* Default Error handler
242
*/
0 commit comments