|
|
|
@@ -167,16 +167,23 @@ abstract class WebController extends BaseController |
|
|
|
|
|
|
|
$this->authorize(); |
|
|
|
|
|
|
|
return $this->run($request); |
|
|
|
$this->transaction->beginTransaction(); |
|
|
|
$ret = $this->run($request); |
|
|
|
$this->transaction->commit(); |
|
|
|
return $ret; |
|
|
|
} catch (GeneralErrorMessageException $e) { |
|
|
|
$this->transaction->rollBack(); |
|
|
|
return $this->failedResponse([], $e->getMessage()); |
|
|
|
} catch (AppCommonException $e) { |
|
|
|
$this->transaction->rollBack(); |
|
|
|
logs()->error(sprintf("Appエラー:%s", $e->getMessage())); |
|
|
|
return $this->failedResponse(); |
|
|
|
} catch (ExclusiveException $e) { |
|
|
|
$this->transaction->rollBack(); |
|
|
|
logs()->error(sprintf("排他エラー:%s", $e->getMessage())); |
|
|
|
return $this->exclusiveErrorResponse(); |
|
|
|
} catch (LogicException $e) { |
|
|
|
$this->transaction->rollBack(); |
|
|
|
logs()->error([ |
|
|
|
sprintf("実装エラー:%s", $e->getMessage()), |
|
|
|
get_class($e), |
|
|
|
@@ -189,13 +196,16 @@ abstract class WebController extends BaseController |
|
|
|
}, ARRAY_FILTER_USE_BOTH)); |
|
|
|
return $this->failedResponse(); |
|
|
|
} catch (ValidationException $e) { |
|
|
|
$this->transaction->rollBack(); |
|
|
|
return $this->validateErrorResponse($e); |
|
|
|
} catch (HttpException $e) { |
|
|
|
$this->transaction->rollBack(); |
|
|
|
if ($e->getStatusCode() === 401) { |
|
|
|
return $this->unAuthorizedResponse(); |
|
|
|
} |
|
|
|
throw e; |
|
|
|
} catch (Exception $e) { |
|
|
|
$this->transaction->rollBack(); |
|
|
|
logs()->error([ |
|
|
|
sprintf("例外エラー:%s", $e->getMessage()), |
|
|
|
get_class($e), |
|
|
|
|