Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BaseException 适配一下getMessage() #13

Closed
zxplethe opened this issue Nov 8, 2023 · 1 comment
Closed

BaseException 适配一下getMessage() #13

zxplethe opened this issue Nov 8, 2023 · 1 comment

Comments

@zxplethe
Copy link

zxplethe commented Nov 8, 2023

在BaseException类中

public function __construct(string $errorMessage = '', array $params = [])
    {
        parent::__construct();
        if (!empty($errorMessage)) {
            $this->errorMessage = $errorMessage;
            $this->message=$errorMessage;//加一行这个可好
        }
        if (!empty($params)) {
            if (array_key_exists('statusCode', $params)) {
                $this->statusCode = $params['statusCode'];
            }
            if (array_key_exists('header', $params)) {
                $this->header = $params['header'];
            }
            if (array_key_exists('errorCode', $params)) {
                $this->errorCode = $params['errorCode'];
            }
            if (array_key_exists('data', $params)) {
                $this->data = $params['data'];
            }
        }
    }
@Tinywan
Copy link
Owner

Tinywan commented Nov 8, 2023

你加这一行的使用场景是?没问题,你可以直接提交PR哦

@Tinywan Tinywan closed this as completed Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants