You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The autodetection often fails completely (like in the case above) or detects the wrong or a random file type, making the rest of the diff look bad.
It'd be cool to split the diff into chunks and highlight them individually. I'm thinking for the example above, these chunks would make sense:
diff --git a/ocfweb/middleware/errors.py b/ocfweb/middleware/errors.py
index e39319e..26dd093 100644
--- a/ocfweb/middleware/errors.py
+++ b/ocfweb/middleware/errors.py
@@ -15,10 +15,6 @@ class OcflibErrorMiddleware:
if isinstance(exception, ResponseException):
return exception.response
- # maybe it's a real exception?
- if settings.DEBUG or settings.TESTING:
- return
-
if isinstance(exception, Http404):
# we don't care about reporting 404 errors
return
@@ -54,6 +50,10 @@ class OcflibErrorMiddleware:
))
except Exception as ex:
print(ex) # just in case it errors again here
+ if blah:
+ do_foo(
+ x, y, z,
+ )
send_problem_report(dedent(
"""\
An exception occured in ocfweb, but we errored trying to report it:
# flake8 complains about 'redefinition' of imported pytest fixtures
ignore = F811
+[some-new-section]
+# lol
+foo = blah
+
[pep8]
# autopep8 will rewrite lines to be shorter, even though we raised the length
ignore = E501
Understanding diffs is a bit hard, but supporting the git diff format and maybe diff -u would be a good start.
The text was updated successfully, but these errors were encountered:
Here's an example diff with several different file types: https://i.fluffy.cc/4GH3s8gk5kvk6LZNLjgHSsHdnc7PQDsR.html
The autodetection often fails completely (like in the case above) or detects the wrong or a random file type, making the rest of the diff look bad.
It'd be cool to split the diff into chunks and highlight them individually. I'm thinking for the example above, these chunks would make sense:
Understanding diffs is a bit hard, but supporting the
git diff
format and maybediff -u
would be a good start.The text was updated successfully, but these errors were encountered: