Fix incorrect error type.

Signed-off-by: Liang-Chi Hsieh <viirya@gmail.com>
Merge pull request #9668 from viirya/fix_error_type

Fix incorrect error type