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

Unable to catch exceptions #123

Closed
Zxurian opened this issue Mar 1, 2017 · 5 comments
Closed

Unable to catch exceptions #123

Zxurian opened this issue Mar 1, 2017 · 5 comments

Comments

@Zxurian
Copy link

Zxurian commented Mar 1, 2017

I have a particularly long running migration that fails out because of the usual "MySQL server has gone away"

I'm trying to catch the PDOExceptions for that if it does, just reconnect, however even just a basic try/catch around my code doesn't seem to be triggering my catches.

Even something as basic as

public function up(){

    try {
        causeException();
    } catch (\Exception $e) {
        var_dump($e);
        die();
    }
}

I'm getting img before any handling of the exception inside my catch block.

Is there anything from phpmig that is intercepting exceptions?

@davedevelopment
Copy link
Owner

Not that I am aware of... have you tried calling phpmig with -vvv, I think that should show a stack trace.

@Zxurian
Copy link
Author

Zxurian commented Mar 2, 2017

Just did that yesterday
img

it doesn't look like the stack trace is making it back up to my actual migration code, as it's never referenced in the stack trace

@davedevelopment
Copy link
Owner

That looks like the adaptors SQL connection has gone away. So your migration has run successfully, but when phpmig tries to record the fact, it's db connection is no good. I'm not sure of the best way to go about fixing it.

@Zxurian
Copy link
Author

Zxurian commented Mar 2, 2017

oh, I hadn't even thought of that. so it's not my actual migration connection that's dissappearing, but phpmig's own connection to it's own database for tracking. That should be a relatively east fix, I'll check on it now.

@Zxurian
Copy link
Author

Zxurian commented Mar 2, 2017

issue resolved with #124

@Zxurian Zxurian closed this as completed Mar 2, 2017
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