public function handleError($status_code, $error_message = null)
    {
        $method = "handle$status_code";
        foreach ($this->errorClasses as $class) {
            $reflection = Utilities::reflectionClassFromObjectOrClass($class);

            if (isset($reflection) && $reflection->hasMethod($method)) {
                $obj = is_string($class) ? new $class() : $class;
                $obj->$method();

                return;
            }
        }

        $description = HttpStatusCodes::getDescription($status_code);

        if (isset($error_message) && $this->mode == Mode::DEBUG) {
            $message = $description . ': ' . $error_message;
        } else {
            $message = $description;
        }

        $output = array(
            'error' => array(
                'code' => $status_code,
                'message' => $message
            )
        );

        $this->setStatus($status_code);
        $this->sendData($output);
    }