Skip to content

Commit

Permalink
passing the name of the desired template in DirectEditor::renderError…
Browse files Browse the repository at this point in the history
…(), simplify method
  • Loading branch information
rivexe committed Dec 15, 2023
1 parent c745a12 commit 1536c82
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions lib/directeditor.php
Original file line number Diff line number Diff line change
Expand Up @@ -267,18 +267,12 @@ public function open(IToken $token): Response {
* Print error page
*
* @param string $error - error message
* @param string $hint - error hint
*
* @return TemplateResponse
*/
private function renderError($error, $hint = "") {
return new TemplateResponse("", "error", [
"errors" => [
[
"error" => $error,
"hint" => $hint
]
]
], "error");
private function renderError($error) {
return new TemplateResponse($this->appName, "directeditorerror", [
"error" => $error
], TemplateResponse::RENDER_AS_ERROR);
}
}

0 comments on commit 1536c82

Please sign in to comment.