failureReason read-only property of the
BackgroundFetchRegistration interface returns a string with a value that indicates a reason for a background fetch failure.
let failureReason = BackgroundFetchRegistration.failureReason;
One of the following strings:
- The background fetch has not completed, or was successful.
- The operation was cancelled by the user, or
- A response had a not-ok status (a status outside the range 200-299).
- A fetch failed for other reasons, for example CORS, or a network failure.
- Storage quota was reached during the operation.
- The provided
downloadTotalwas exceeded. This value was set when the background fetch was registered.
BackgroundFetchRegistration.failureReason to the console prints the reason the fetch failed, or an empty string if it was successful or has not yet completed.
The definition of 'BackgroundFetchRegistration.failureReason' in that specification.
BCD tables only load in the browser