add a Error extension to handle Error object for JSON communication