public static TxnErrorMsg getTxnErrorMsg(long errorCode) {
      for (TxnErrorMsg txnErrorMsg : values()) {
        if (txnErrorMsg.getErrorCode() == errorCode) {
          return txnErrorMsg;
        }
      }
      return TxnErrorMsg.NONE;
    }
The following class represents all the error messages that are handled for aborts.
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/txn/TxnErrorMsg.java