Skip to content

Commit f24753b

Browse files
committed
add rescue for pg untranslatable char error
1 parent c9bfc26 commit f24753b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

app/controllers/application_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,7 @@ def rescue_from_exceptions
528528
rescue ActiveRecord::StatementInvalid => e
529529
# Bad encodings, Invalid UUIDs, non-base64'd creds, etc.
530530
case e.cause
531-
in PG::InvalidTextRepresentation | PG::CharacterNotInRepertoire
531+
in PG::InvalidTextRepresentation | PG::CharacterNotInRepertoire | PG::UntranslatableCharacter
532532
render_bad_request detail: 'The request could not be completed because it contains an invalid byte sequence (check encoding)', code: 'ENCODING_INVALID'
533533
in PG::Error if e.message in /incomplete multibyte character/ | /invalid multibyte character/
534534
render_bad_request detail: 'The request could not be completed because it contains an invalid byte sequence (check encoding)', code: 'ENCODING_INVALID'

0 commit comments

Comments
 (0)