Raise YHSM_Error instead of Exception.