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

在你的"如何组织PHP中的异常"中有个疑问. #1

Open
km3945 opened this issue Sep 12, 2017 · 1 comment
Open

在你的"如何组织PHP中的异常"中有个疑问. #1

km3945 opened this issue Sep 12, 2017 · 1 comment

Comments

@km3945
Copy link

km3945 commented Sep 12, 2017

class UserNotFoundException extends RuntimeException
{
    public static function forUserId(string $userId) : self
    {
        return new self(sprintf(
            'User with the ID: %s does not exist',
            $userId
        ));
    }
}

在使用该方法 UserNotFoundException::forUserId(1); 时Exception抛出的line 是当前这个public static function forUserId 所在的行.不是我逻辑调用的时的行.这如何处理.

@zhuanxuhit
Copy link
Owner

有具体的点的错误信息嘛

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