/** * @test */ public function shouldGetErrorWithClassForDebug() { //given Config::overrideProperty('debug')->with(true); $userException = new UserException('Winter is coming!'); //when $error = Error::forException($userException); //then $this->assertEquals('Ouzo\\UserException: Winter is coming!', $error->message); }
public static function forException($httpCode, Exception $exception) { return new OuzoExceptionData($httpCode, array(Error::forException($exception)), $exception->getTraceAsString()); }