Skip to content

Commit

Permalink
Merge pull request #19 from DivanteLtd/feature
Browse files Browse the repository at this point in the history
make errors more verbose
  • Loading branch information
Kuba Płaskonka authored Jul 8, 2021
2 parents c70bc17 + c73f0b3 commit 85d73e4
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 85d73e4

Please sign in to comment.