Home  >  Article  >  Backend Development  >  Thinkphp turns off debug, how can the thrown information in the third-party library be displayed?

Thinkphp turns off debug, how can the thrown information in the third-party library be displayed?

WBOY
WBOYOriginal
2016-09-08 08:29:391019browse

Because of tp, the throwing function is used, but when debug is turned off, those error throwing functions are blocked.
Once an error is thrown, it will jump directly to the error page without displaying the error content.
Like WeChat Pay and other class libraries, after I referenced them, some exceptions were thrown in the program and I saw the content. How can I turn off debug and still see the thrown content.

<code>throw new SDKRuntimeException("统一支付接口中,缺少必填参数openid!trade_type为JSAPI时,openid为必填参数!" . "<br>");


class  SDKRuntimeException extends Exception {
    public function errorMessage()
    {
        return $this->getMessage();
    }

}




</code>
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn