From 0965d62be00a7820f97284704dc71f37e661b412 Mon Sep 17 00:00:00 2001 From: Kevin J Hoerr Date: Sun, 26 Aug 2018 01:38:28 -0400 Subject: Begin migration to Rust; Add actix-web, diesel as main dependencies --- private/Controller/Controller.php | 92 --------------------------------------- 1 file changed, 92 deletions(-) delete mode 100644 private/Controller/Controller.php (limited to 'private/Controller') diff --git a/private/Controller/Controller.php b/private/Controller/Controller.php deleted file mode 100644 index 586be15..0000000 --- a/private/Controller/Controller.php +++ /dev/null @@ -1,92 +0,0 @@ - $err->getMessage())); - } - } - - /** - * Creates and returns a Result object. - * - * @param string $resultType The type of result to send back to the client. - * @param array $result The result object to send back to the client. - * - * @return Model\Result - */ - public static function createResult ( - string $resultType, - array $result - ): Model\Result { - try { - return new Model\Result($resultType, $result); - } catch (\Exception $err) { - return new Model\Result("ERROR", array($err->getMessage())); - } - } - - /** - * Obtain the error result based on the exception that was thrown. - * - * @param \Exception $err the error that was thrown. - * - * @return Model\Result - */ - public static function errorResult (\Exception $err): Model\Result - { - $errorType = ""; - // Juggle error: objective is to sort error type - try { - throw $err; - } catch (\PDOException $e) { - $errorType = "DATABASE_ERROR"; - } catch (\Exception $e) { - $errorType = "ERROR"; - } - - return new Model\Result($errorType, array("error" => $err->getMessage())); - } -} -- cgit