Define and throw a dedicated exception instead of using a generic one.