onError Function misssing?

Hi.

I need it. and fix code.
If no problem at origin then reject this request.

thanks.

--
commit message
--
fix onError funciton.
detach from Storage before connection close.