MCPcopy Create free account
hub / github.com/Acode-Foundation/Acode / error

Function error

src/utils/helpers.js:177–194  ·  view source on GitHub ↗

* * @param {Error} err * @param {...string} args * @returns {PromiseLike }

(err, ...args)

Source from the content-addressed store, hash-verified

175 * @returns {PromiseLike<void>}
176 */
177 error(err, ...args) {
178 if (err.code === 0) {
179 toast(err);
180 return;
181 }
182
183 let hide = null;
184 const onhide = () => {
185 if (hide) hide();
186 };
187
188 const msg = this.errorMessage(err, ...args);
189 alert(strings.error, msg, onhide);
190
191 return new Promise((resolve) => {
192 hide = resolve;
193 });
194 },
195 /**
196 * Returns unique ID
197 * @returns {string}

Callers

nothing calls this directly

Calls 1

alertFunction · 0.85

Tested by

no test coverage detected