Skip to content

Commit a50217b

Browse files
committed
ADD: constants for log message
1 parent d3ac383 commit a50217b

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Services/ExceptionLogService.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
class ExceptionLogService implements ExceptionLogServiceInterface {
1313
use LoggerAwareTrait;
1414

15+
const MESSAGE_ERROR = 'InternalServerError';
16+
const MESSAGE_INFO = 'Exception was thrown';
17+
1518
/**
1619
* @param HttpExceptionInterface $exception
1720
*/
@@ -22,9 +25,9 @@ public function logHttpException(HttpExceptionInterface $exception): void {
2225

2326
$context = FlattenExceptionHelper::createFromThrowable($exception)->toArray();
2427
if ($exception->getStatusCode() >= 500) {
25-
$this->logger->error("InternalServerError", $context);
28+
$this->logger->error(self::MESSAGE_ERROR, $context);
2629
} else {
27-
$this->logger->info("Exception was thrown", $context);
30+
$this->logger->info(self::MESSAGE_INFO, $context);
2831
}
2932
}
3033

0 commit comments

Comments
 (0)