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

Rollbar $last_error['type'] only support E_ERROR #55

Closed
diogopms opened this issue May 27, 2015 · 4 comments
Closed

Rollbar $last_error['type'] only support E_ERROR #55

diogopms opened this issue May 27, 2015 · 4 comments

Comments

@diogopms
Copy link
Contributor

Hi,
I needed to change this method, because my system (nginx+php5-fpm) i have $last_error['type'] = 4 instead of 1 (E_ERROR).

Can you give help me or give information about that, because i want to use rollbar if some syntax error appear.

public static function report_fatal_error() {
        // Catch any fatal errors that are causing the shutdown
        $last_error = error_get_last();


        if (!is_null($last_error)) {
             $last_error['type'] = E_ERROR;
            switch ($last_error['type']) {
                case E_ERROR:
                    self::$instance->report_php_error($last_error['type'], $last_error['message'], $last_error['file'], $last_error['line']);
                    break;
            }
        }
    }
@coryvirok
Copy link
Contributor

Looks like we should add in a new case:

switch ($last_error['type']) {
    case E_PARSE:
    case E_ERROR:
        self::$instance->report_php_error($last_error['type'], $last_error['message'], $last_error['file'], $last_error['line']);
        break;
}

@brianr look good?

@brianr
Copy link
Member

brianr commented May 27, 2015

Looks good to me.

@brianr
Copy link
Member

brianr commented May 27, 2015

Fixed in #56

@brianr brianr closed this as completed May 27, 2015
@brianr
Copy link
Member

brianr commented May 27, 2015

Fix released in version 0.11.2 (now up on Packagist)

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

3 participants