parseErrorMessage function
Implementation
String parseErrorMessage(dynamic err) {
if (err == null) return 'Error desconocido';
if (err is String && err.isNotEmpty) {
return err;
}
if (err is Exception) {
return err.toString();
}
if (err is Error) {
return err.toString();
}
return 'Ha ocurrido un error inesperado';
}