[fix] return error and throw