I have just finished migrating https://github.com/ylecuyer/onmove200 to this gem. overall it went seamlessly except for the error class which doesn't report error and status when doing an upload.
The raw body looks like this:
{:status=>400, :headers=>{"date"=>"Wed, 18 Dec 2019 22:40:08 GMT", "content-type"=>"application/json; charset=utf-8", "transfer-encoding"=>"chunked", "connection"=>"close", "cache-control"=>"no-cache", "via"=>"1.1 linkerd", "x-download-options"=>"noopen", "status"=>"400 Bad Request", "x-ratelimit-limit"=>"600,30000", "x-request-id"=>"c7a703a2-2943-4568-ad0e-4feb5457d982", "referrer-policy"=>"strict-origin-when-cross-origin", "x-frame-options"=>"SAMEORIGIN,DENY", "x-ratelimit-usage"=>"6,35", "x-content-type-options"=>"nosniff", "x-permitted-cross-domain-policies"=>"none", "vary"=>"Origin", "x-xss-protection"=>"1; mode=block"}, :body=>{"id"=>3132246002, "id_str"=>"3132246002", "external_id"=>"ACT_0007.OMD.gpx", "error"=>"ACT_0007.OMD.gpx duplicate of activity 2941970362", "status"=>"There was an error processing your activity.", "activity_id"=>nil}}
Hi
I have just finished migrating https://github.com/ylecuyer/onmove200 to this gem. overall it went seamlessly except for the error class which doesn't report error and status when doing an upload.
The raw body looks like this:
But the
Strava::Errors::Fault
only reportsmessage
anderrors
which don't exist: https://github.com/dblock/strava-ruby-client/blob/master/lib/strava/errors/fault.rbFor the moment I have added both
error
andstatus
: https://github.com/ylecuyer/strava-ruby-client/blob/master/lib/strava/errors/fault.rbDo you know if the error message format changed ? Or is it just this endpoint with funky format?
If the fix is worth it, I'll open a PR