You can reinvent the wheel if you want to, but you do not have to.
But if you want to you can extend Exception or a subclass, like the link above and provide your own functionality

--- Update ---...