+ def error(self, msg: str, status: int = 400) -> falcon.HTTPError:
+ if status == 400:
+ return falcon.HTTPBadRequest(description=msg)
+ if status == 404:
+ return falcon.HTTPNotFound(description=msg)
+
+ return falcon.HTTPError(status, description=msg)
+
+
+ def create_response(self, status: int, output: str, content_type: str) -> None:
+ self.response.status = status
+ self.response.text = output
+ self.response.content_type = content_type