Add errorToString method for cross browser use