quintel / etmoses

Online decision support tool to create local energy situations for neighbourhoods, cities and regions with a time resolution of 15 minutes created and maintained by Quintel – Not maintained
https://moses.energytransitionmodel.com
MIT License
11 stars 3 forks source link

[Airbrake] [Production] invalid byte sequence in UTF-8 #1428

Closed dennisquintel closed 8 years ago

dennisquintel commented 8 years ago

Airbrake error: #4500 Airbrake project: ETMoses

Error type: ArgumentError Error message: invalid byte sequence in UTF-8 Where: load_profiles#update Occurred at: Sep 15, 2016 12:14:30 UTC First seen at: Sep 15, 2016 12:14:30 UTC Occurrences: 1 (1 since last deploy on Sep 13, 2016 14:45:01 UTC)

URL: https://moses.energytransitionmodel.com/load_profiles/477 File: [GEM_ROOT]/bundler/gems/merit-f88fa00202e1/lib/merit/curve.rb

Backtrace:

[GEM_ROOT]/bundler/gems/merit-f88fa00202e1/lib/merit/curve.rb:104:in match
[GEM_ROOT]/bundler/gems/merit-f88fa00202e1/lib/merit/curve.rb:104:in match
[GEM_ROOT]/bundler/gems/merit-f88fa00202e1/lib/merit/curve.rb:104:in load_file
[PROJECT_ROOT]/app/models/curve_component.rb:38:in validate_curve_length
antw commented 8 years ago

This is happening because someone is trying to upload a load profile with malformed UTF-8 characters. There's no reason for a load profile to contain any UTF-8 characters, so while this error is ugly, it's probably for the best since an invalid load profile would not work correctly in a calculation.

What we should do is catch these errors and show the visitor a nicer error message.