Skip to content

Commit

Permalink
♻️ Deprecate client-side Alchemy#handleError() method in favour of …
Browse files Browse the repository at this point in the history
…`registerError()`
  • Loading branch information
skerit committed Jul 25, 2024
1 parent eea4dfd commit 06d40f1
Showing 1 changed file with 19 additions and 5 deletions.
24 changes: 19 additions & 5 deletions lib/core/client_alchemy.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ Alchemy.setMethod(function distinctProblem(id, message, options = {}) {
});

/**
* Register a custom handler
* Register a custom handler for the given type
*
* @author Jelle De Loecker <jelle@elevenways.be>
* @since 1.3.21
Expand Down Expand Up @@ -272,6 +272,20 @@ Alchemy.setMethod(function getAllCustomHandlers(type) {
return [];
});

/**
* Deprecated alias to `registerError()`
*
* @author Jelle De Loecker <jelle@elevenways.be>
* @since 1.0.5
* @version 1.4.0
*
* @param {Error} err
* @param {Object} config
*/
Alchemy.setMethod(function handleError(err, config) {
return this.registerError(err, config);
});

/**
* Actually print a log message
*
Expand Down Expand Up @@ -1268,18 +1282,18 @@ Alchemy.setMethod(function enableWebsockets() {
});

/**
* Handle an error
* Register an error
*
* @author Jelle De Loecker <jelle@elevenways.be>
* @since 1.0.5
* @version 1.0.5
* @version 1.4.0
*
* @param {Error} err
* @param {Object} config
*/
Alchemy.setMethod(function handleError(err, config) {
Alchemy.setMethod(function registerError(err, config) {

var message;
let message;

if (!config) {
config = {};
Expand Down

0 comments on commit 06d40f1

Please sign in to comment.