Error Service
The reduceErrors function simplifies error handling by converting various Salesforce error formats into a single, user-friendly string.
Why Error Service?
- Handle Errors Automatically - No matter if you pass an array, an object, or just a string, the error message will be reduced to a single string.
Quick Start
js
import { reduceErrors } from 'c/errorService';
try {
// some code that may throw an error
} catch (error) {
const errorMessage = reduceErrors(error);
// Now you can display `errorMessage` to the user.
}