Require the key be passed into createClient()#125
Conversation
|
As a side note with this change, I had to update a couple of the existing tests to include the Airbrake key during initialization. If you need me to break these into a separate commit or PR, let me know. Also I decided to check the Also if you'd like some other way of handling this than throwing an error, let me know. I think this is the only place where the library actually throws, so I'd understand if you'd like this handled differently. |
lib/airbrake.js
Outdated
There was a problem hiding this comment.
This check is probably not enough. We should also check projectId.
There was a problem hiding this comment.
Ok, I can take care of that. I'd seen multiple tests leave out the projectId field so I assumed that the project key wasn't 100% required (though in hindsight the key is required, so we might as well add checks for the projectId as well). Thanks for reviewing!
|
@droppedoncaprica friendly ping. |
This change adds a check to ensure createClient() gets a key and
projectId passed into the createClient() call.
In previous versions of Airbrake the first argument was the key,
meaning that blindly upgrading the Airbrake version would result in
Airbrake throwing an error when reporting an error.
This change adds requirements that both the key and projectId be
supplied, "failing fast" if either of these are omitted. This
gives the developer feedback on this quickly, rather than have
the Airbrake library throw errors when reporting errors to the
service.
Fixes #124
This change adds a check to ensure createClient() gets a key passed
into the createClient() call.
In previous versions of Airbrake the first argument was the key,
meaning that blindly upgrading the Airbrake version would result in
Airbrake throwing an error when reporting an error. This change
results in this "failing fast", giving the developer feedback on
the incorrect usage.
Fixes #124