Hello all,
I'm trying to work with exceptions.
So I have something like:
If something bad occurs:
throw new CreateContactException($codigo, $result->msg);
Later on, I will, try and if not ok, catch:
try
{
createContact();
}
catch(CreateContactException $e)
{
$error .= 'An error occurred with the code:'.$e->getCode().' and message:'.$e->getMessage();
}
1) Will this work? I mean, this getCode() and getMessage() aren't related with the CreateContactException arguments are they?
2) Must I have, somewhere, a CreateContactException class that extends Exception? I mean, can we have custom names for our exceptions without the need of creating an extended class?
Thanks a lot in advance, MEM