Commit 7d9d2aca authored by Douglas Barbosa Alexandre's avatar Douglas Barbosa Alexandre

Merge branch '353558-actionview-template-error-ipynbdiff-invalidtokenerror' into 'master'

Resolve "ActionView::Template::Error: IpynbDiff::InvalidTokenError"

See merge request gitlab-org/gitlab!81420
parents 6208ca1d a660eaab
......@@ -10,14 +10,12 @@ module Gitlab
transformed_for_diff(new_blob, old_blob)
Gitlab::AppLogger.info({ message: 'IPYNB_DIFF_GENERATED' })
end
rescue IpynbDiff::InvalidNotebookError => e
rescue IpynbDiff::InvalidNotebookError, IpynbDiff::InvalidTokenError => e
Gitlab::ErrorTracking.log_exception(e)
nil
end
def transformed_diff(before, after)
Gitlab::AppLogger.info({ message: 'IPYNB_DIFF_GENERATED' })
transformed_diff = IpynbDiff.diff(before, after,
raise_if_invalid_nb: true,
diffy_opts: { include_diff_info: true }).to_s(:text)
......
......@@ -57,7 +57,7 @@ module Gitlab
IpynbDiff.diff(source_diff.old_blob&.data, source_diff.new_blob&.data,
raise_if_invalid_nb: true,
diffy_opts: { include_diff_info: true })
rescue IpynbDiff::InvalidNotebookError => e
rescue IpynbDiff::InvalidNotebookError, IpynbDiff::InvalidTokenError => e
Gitlab::ErrorTracking.log_exception(e)
nil
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment