Move error handler into namespacing