diff options
Diffstat (limited to 'routers/router.php')
-rw-r--r-- | routers/router.php | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/routers/router.php b/routers/router.php index b061411..cee1c35 100644 --- a/routers/router.php +++ b/routers/router.php @@ -45,16 +45,21 @@ abstract class Router { try { $complete_command = $this->build_command($command, $parameters); } catch (Exception $e) { - return $e->getMessage(); + throw $e; } $auth = Authentication::instance($this->config); - $auth->connect(); - $data = $auth->send_command($complete_command); - $auth->disconnect(); - log_to_file('[client: '.$this->requester.'] '.$this->config['host'].'> '. - $complete_command); + try { + $auth->connect(); + $data = $auth->send_command($complete_command); + } catch (Exception $e) { + throw $e; + } finally { + $auth->disconnect(); + log_to_file('[client: '.$this->requester.'] '.$this->config['host'].'> '. + $complete_command); + } return $data; } |