[FORGE-881] Change the thrown exception to the correct type as indicated by the interface