Fix incorrect error type.

Signed-off-by: Liang-Chi Hsieh <viirya@gmail.com>