{"action":"opened","issue":{"url":"https://api.github.com/repos/getsentry/sentry-php/issues/332","repository_url":"https://api.github.com/repos/getsentry/sentry-php","labels_url":"https://api.github.com/repos/getsentry/sentry-php/issues/332/labels{/name}","comments_url":"https://api.github.com/repos/getsentry/sentry-php/issues/332/comments","events_url":"https://api.github.com/repos/getsentry/sentry-php/issues/332/events","html_url":"https://github.com/getsentry/sentry-php/issues/332","id":169863819,"number":332,"title":"Checking for @ in handleError","user":{"login":"bm-pzegardlo","id":5180671,"avatar_url":"https://avatars.githubusercontent.com/u/5180671?v=3","gravatar_id":"","url":"https://api.github.com/users/bm-pzegardlo","html_url":"https://github.com/bm-pzegardlo","followers_url":"https://api.github.com/users/bm-pzegardlo/followers","following_url":"https://api.github.com/users/bm-pzegardlo/following{/other_user}","gists_url":"https://api.github.com/users/bm-pzegardlo/gists{/gist_id}","starred_url":"https://api.github.com/users/bm-pzegardlo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bm-pzegardlo/subscriptions","organizations_url":"https://api.github.com/users/bm-pzegardlo/orgs","repos_url":"https://api.github.com/users/bm-pzegardlo/repos","events_url":"https://api.github.com/users/bm-pzegardlo/events{/privacy}","received_events_url":"https://api.github.com/users/bm-pzegardlo/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-08-08T07:58:49Z","updated_at":"2016-08-08T07:58:49Z","closed_at":null,"body":"If PHP expression has been prefixed by @ and error occurred, error_reporting() will return 0 in registered error handler. This error will be not logged in to Sentry cause in handleError there is a checking that error_reporting is not equal to 0.\r\n\r\nBut the same will happen if error_reporting has been set to 0 in a global scope. So checking for this in handleError and handleFatalError is not a good idea when custom error types has been set for sentry client. In my opinion handle error function should like this:\r\n\r\n```php\r\n       public function handleError($code, $message, $file = '', $line = 0, $context=array())\r\n       {\r\n            $error_types = $this->error_types;\r\n            if ($error_types === null) {\r\n                $error_types = error_reporting();\r\n            }\r\n            if ($error_types & $code) {\r\n                $e = new ErrorException($message, 0, $code, $file, $line);\r\n                $this->handleException($e, true, $context);\r\n            }\r\n            if ($this->call_existing_error_handler) {\r\n                if ($this->old_error_handler !== null) {\r\n                    return call_user_func($this->old_error_handler, $code, $message, $file, $line, $context);\r\n                } else {\r\n                    return false;\r\n                }\r\n            }\r\n       }\r\n```\r\n\r\n"}}
{"actor":{"display_login":"bm-pzegardlo"}}