I'm seeing MySQL use an error code like this:

  533   			throw SQLError.createSQLException("Unable to unwrap to "
  534   					+ iface.toString(), SQLError.SQL_STATE_ILLEGAL_ARGUMENT, this.exceptionInterceptor);