Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Produce nice error message when .exe submitted instead of source code #257

Open
tom93 opened this issue Jan 8, 2024 · 0 comments · May be fixed by #268
Open

Produce nice error message when .exe submitted instead of source code #257

tom93 opened this issue Jan 8, 2024 · 0 comments · May be fixed by #268

Comments

@tom93
Copy link
Contributor

tom93 commented Jan 8, 2024

Currently, if a user tries to submits and uploads their compiled .exe instead of their source file, it causes a 500 Internal Server Error (invalid byte sequence in UTF-8). We should instead display a helpful error message. (Note that this error could also happen if the source file has the wrong encoding.)

Log:

Completed 500 Internal Server Error in 112ms (ActiveRecord: 58.2ms)
invalid byte sequence in UTF-8 excluded from capture: DSN not set

ArgumentError (invalid byte sequence in UTF-8):
  app/controllers/problems_controller.rb:90:in `block in submit'
  app/controllers/problems_controller.rb:89:in `submit'


  Rendered /home/user/.rvm/gems/ruby-2.4.10/gems/actionpack-4.2.11.3/lib/action_dispatch/middleware/templates/rescues/_source.erb (7.4ms)
  Rendered /home/user/.rvm/gems/ruby-2.4.10/gems/actionpack-4.2.11.3/lib/action_dispatch/middleware/templates/rescues/_trace.html.erb (6.2ms)
  Rendered /home/user/.rvm/gems/ruby-2.4.10/gems/actionpack-4.2.11.3/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb (2.0ms)
  Rendered /home/user/.rvm/gems/ruby-2.4.10/gems/actionpack-4.2.11.3/lib/action_dispatch/middleware/templates/rescues/diagnostics.html.erb within rescues/layout (60.6ms)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant