<?php

namespace framework\library\exception;

use Throwable;

class RouteException extends BaseException {
    public function __construct($message = "", $code = 0, Throwable $previous = null) {
        $message = $this->processMessage($message);
        parent::__construct($message, $code, $previous);
    }

    /**
     * @param \Exception $exception
     */
    public function handler($exception = null) {
        parent::handler($this); // TODO: Change the autogenerated stub
    }

    private function processMessage($message) {
        $message = str_replace([
            'Module',
            'Controller',
            'function',
            'doesn\'t exist',
        ],[
            '模块',
            '控制器',
            '方法',
            '不存在',
        ], $message);
        return $message;
    }
}