Refactored error code and added transaction abort on error.
Refactored error code and added transaction abort on error.

btulchinsky/idbfs,humphd/filer,btulchinsky/idbfs,filerjs/filer,humphd/filer,sedge/filer,sedge/filer,filerjs/filer