fix error is not defined bug.

the method is `fail`,but used the `error`