Crédit Agricole interview question

How to write a custom Exception method?