getToast:function(component, event, helper, title, message, type){
var toastEvent = $A.get("e.force:showToast");
toastEvent.setParams({
title : title,
message: message,
type: type,
});
toastEvent.fire();
},
How receive from apex code the error by catching?
View this link https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/controllers_server_apex_custom_errors.htm