Add a code() method to Error (Javascript)