Fixed code and spec for Excon error

Fixed code and spec for Excon error.