{"action":"closed","issue":{"url":"https://api.github.com/repos/spatie/laravel-permission/issues/234","repository_url":"https://api.github.com/repos/spatie/laravel-permission","labels_url":"https://api.github.com/repos/spatie/laravel-permission/issues/234/labels{/name}","comments_url":"https://api.github.com/repos/spatie/laravel-permission/issues/234/comments","events_url":"https://api.github.com/repos/spatie/laravel-permission/issues/234/events","html_url":"https://github.com/spatie/laravel-permission/issues/234","id":215988952,"number":234,"title":"RoleDoesNotExist Exception to Log","user":{"login":"yc-public","id":8948755,"avatar_url":"https://avatars3.githubusercontent.com/u/8948755?v=3","gravatar_id":"","url":"https://api.github.com/users/yc-public","html_url":"https://github.com/yc-public","followers_url":"https://api.github.com/users/yc-public/followers","following_url":"https://api.github.com/users/yc-public/following{/other_user}","gists_url":"https://api.github.com/users/yc-public/gists{/gist_id}","starred_url":"https://api.github.com/users/yc-public/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yc-public/subscriptions","organizations_url":"https://api.github.com/users/yc-public/orgs","repos_url":"https://api.github.com/users/yc-public/repos","events_url":"https://api.github.com/users/yc-public/events{/privacy}","received_events_url":"https://api.github.com/users/yc-public/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-03-22T08:40:17Z","updated_at":"2017-03-22T18:43:24Z","closed_at":"2017-03-22T18:43:24Z","body":"I want to catch the roledoesnotexist exception and log it into log file. However, i couldn't get the error messages.\r\n\r\nMy controller : \r\n\r\n```\r\nuse Spatie\\Permission\\Exceptions\\RoleDoesNotExist;\r\n\r\npublic function createAccount() {\r\n\t\ttry {\r\n\t\t\t\t$user = User::create([\r\n\t\t\t\t'email' => 'super@abc.com',\r\n\t\t\t\t'password' => bcrypt(\"abc\"),\r\n\t\t\t\t]);\r\n\t\t\t\t\r\n\t\t\t\t$user->assignRole('super!admin');\r\n\t\t\t} catch (RoleDoesNotExist $e) {\r\n\t\t\tLog::error('Register Failed: ' . $e->getMessage(), $this->_logRoute);\r\n\t\t\treturn $this->responseFailed();*/\r\n\t\t} catch (\\Exception $e) {\r\n\t\t\tLog::error('Register Failed: ' . $e->getMessage(), $this->_logRoute);\r\n\t\t\t//return $this->responseFailed();\r\n\t\t}\r\n}\r\n```\r\n\r\nMy Log:\r\n\r\n2017-03-22 16:32:04 local (ERROR) [\"SuperAdminController@createAccount\",19] --- Register Failed: \r\n\r\nwhich is showing nothing about the exception message."}}
{"actor":{"display_login":"freekmurze"}}