Commit Graph

13 Commits

Author SHA1 Message Date
Paul Melnikow
fc12b591db Reorganize BaseService-related modules (#2831)
Ref #2698
2019-01-22 23:52:13 -05:00
Paul Melnikow
8dc8afeb55 Avoid func declarations using function keyword (#2813)
We had only a few function expressions declared with the function keyword; almost everything is using function declarations.

This came up after this discussion: https://github.com/badges/shields/pull/2803#discussion_r249011621 though is actually not related ot that example.

What’s being removed is a third option, which is assigning to a variable a function expression using the `function` keyword. There’s still room for the programmer to choose between arrow function expressions and function declarations.
2019-01-21 15:33:43 -05:00
Pyves
7417dc5f6c Delete BaseHTTPService and implement new BaseXmlService (affects [eclipse-marketplace f-droid]; also testing on [uptimerobot circleci]) (#2037) 2018-09-03 19:37:37 +01:00
Pyves
b0070ff861 [GitHub] Error message customisation for all status codes (#1888) 2018-08-14 18:57:24 +01:00
Paul Melnikow
cd6c38a616 Add InvalidParameter runtime error and return inaccessible for 5xx errors (#1890)
* InvalidParameter: New error type
* Return inaccessible for 5xx errors from services
* Add test for Inaccessible on 5xx
* Add tests for named error types
2018-08-11 21:05:56 +01:00
Paul Melnikow
7a664ca3e8 Run prettier (#1866)
Merging this separately so the commit with the tooling change is readable. This is a follow-on to #1167 which turned prettier on.
2018-08-08 17:57:14 -04:00
Paul Melnikow
6e09a93cf0 Provide a descriptive message when json can’t be parsed (#1796)
* Test handling of invalid JSON on BaseJsonService
* Remove invalidJSON tests from new-style services
2018-07-23 19:35:42 -05:00
chris48s
bf53e612f5 [cdnjs gem] make exception classes more consistent (#1683)
make exception classes more consistent
2018-05-15 18:57:33 +01:00
chris48s
8fcc13d5bc refactor [cdnjs] integration (#1668)
* pass error object to InvaildResponse()

this prevents us from throwing
TypeError: Cannot read property 'stack' of undefined
when we attempt to parse invalid json

* refactor [cdnjs] integration
2018-05-04 21:55:51 +01:00
Paul Melnikow
416d433fa0 [appveyor] Error handling in BaseService (#1590)
Make a clear distinction between programmer errors ("internal errors") and runtime errors, and allow configuring the server to let the programmer errors bubble up in development and unit testing. This saves a huge amount of time because it generates ordinary stack traces when things go wrong. And, if these errors occur in production, we'll catch them, and display **shields | internal error** which is the equivalent of a 500 error.
2018-04-01 22:04:22 -05:00
Danial
3cb71037fd checkErrorResponse update default (#1501) 2018-02-15 23:34:38 +01:00
chris48s
7c6723a79d service tests for [docker] (#1428) 2018-01-15 22:03:52 -05:00
chris48s
9cb9d5984d [requires] add tests for requires.io service, review error handling (#1361) 2018-01-02 20:13:10 -07:00