New handle of error

I would delete everything in the end of this PR, it still lacks Atom.