Add an Error subclass for wrapping Backbone errors.

Review Request #11420 — Created Jan. 29, 2021 and updated

david
Review Board
master
e880796...
reviewboard

As part of some future-looking work on our JavaScript codebase, we need
a way to wrap errors from Backbone in a single object. Most backbone
error callbacks take three arguments: the object that encountered the
error (either a Model or Collection instance), the request (a
jQuery.XHR), and the options object that was passed into the call that
generated the error. This new error subclass wraps all of that up
together, setting the default message on the error to be the errorText
from the XHR object.

Used this in conjunction with other changes.

Description From Last Updated

Col: 7 'BackboneError' is defined but never used.

reviewbotreviewbot

Should be modelOrCollection, here and in the argument, since that's the variable name format we use in JavaScript.

chipx86chipx86
Checks run (1 failed, 1 succeeded)
flake8 passed.
JSHint failed.

JSHint

chipx86
  1. 
      
  2. Should be modelOrCollection, here and in the argument, since that's the variable name format we use in JavaScript.

  3. 
      
Loading...