Skip to content

Commit

Permalink
SPARQL-EP エラー時のアラートの追加
Browse files Browse the repository at this point in the history
  • Loading branch information
miyacorata committed Jul 6, 2021
1 parent 183ecc3 commit 55a9198
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/Helpers/SparqlHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ function sparqlQueryOrDie(string $query, int $timeout = 5, bool $predicateReplac
try {
$res = sparqlQuery($query, $timeout, $predicateReplace);
}catch (\Illuminate\Http\Client\ConnectionException $e){
Log::channel()->critical('SPARQL-EP 接続エラー'.PHP_EOL.$e->getMessage());
$message = "SPARQLエンドポイントに接続できませんでした。\n管理者までご連絡ください。";
abort(502, $message);
exit();
Expand All @@ -48,6 +49,7 @@ function sparqlQueryOrDie(string $query, int $timeout = 5, bool $predicateReplac
}else{
$message = "SPARQLエンドポイントから無効な応答が返されました。\n";
$message .= "通常と異なるエラーです。至急管理者までご連絡ください。\n";
Log::channel('slack')->critical('SPARQL-EP 無効応答'.PHP_EOL.$e->getMessage());
}
$message .= PHP_EOL.'SPARQL endpoint returned '.$e->getCode();
abort(502, $message);
Expand Down

0 comments on commit 55a9198

Please sign in to comment.