Skip to content

Commit

Permalink
make errors more verbose
Browse files Browse the repository at this point in the history
  • Loading branch information
Krzysztof Marczak committed Jul 8, 2021
1 parent c70bc17 commit c73f0b3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public function translateFieldAction(Request $request, ProviderFactory $provider
} catch (\Throwable $exception) {
return $this->adminJson([
'success' => false,
'message' => 'Something went wrong',
'message' => $exception->getMessage()
]);
}

Expand Down
2 changes: 1 addition & 1 deletion src/DivanteTranslationBundle/Provider/DeeplProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public function translate(string $data, string $targetLanguage): string
$body = $response->getBody()->getContents();
$data = json_decode($body, true);
} catch (\Throwable $exception) {
throw new TranslationException();
throw new TranslationException($exception->getMessage());
}

return $data['translations'][0]['text'];
Expand Down

0 comments on commit c73f0b3

Please sign in to comment.