code: String eglErrorToString(int errorCode) {
          if (errorCode >= 0x3000 && errorCode < 0x3020) {
              for (Field field : EGL.class.getFields()) {
                  try {
                      if (field.getName().startsWith("EGL_")
                              && field.getType() == Integer.TYPE
                              && field.getInt(null) == errorCode) {
                          return field.getName();
                      }
                  } catch (IllegalAccessException e) {
                  }
              }
          }
          return new Formatter()
                  .format("0x%04x", errorCode & 0xffff)
                  .out()
                  .toString();
      }
docs: Convert an EGL error code such as EGL_BAD_CONTEXT to a string
  representation.
  @param errorCode the EGL error code
  @return the constant name of the error code. If errorCode cannot be
  matched to an EGL error, a string representation of the error code's
  value is returned.