Checks if the message is an GreenPepper server tagged Exception.
If so an GreenPepperServerException will be thrown with the error id found.
</p>
@param object the error id found.
165334
private static void checkErrors(Object object) throws GreenPepperServerException
    {
        if (object instanceof Exception)
        {
            throw new GreenPepperServerException(GreenPepperServerErrorKey.CALL_FAILED, ((Exception)object).getMessage());
        }
        
        if (object instanceof String)
        {
            String msg = (String)object;
            if (!StringUtils.isEmpty(msg) && msg.contains(GreenPepperServerErrorKey.ERROR))
            {
                String errorId = msg.replace(GreenPepperServerErrorKey.ERROR, "");
                
                throw new GreenPepperServerException(errorId, errorId);
            }
        }
    }
785013
private void extractMessage(JsonObject object) {
        // Prefer to pull the message out of meta
        JsonObject meta = object.getAsJsonObject("meta");
        if (meta != null) {
            JsonPrimitive msg = meta.getAsJsonPrimitive("msg");
            if (msg != null) {
                this.message = msg.getAsString();
                return;
            }
        }

        // Fall back on error
        JsonPrimitive error = object.getAsJsonPrimitive("error");
        if (error != null) {
            this.message = error.getAsString();
            return;
        }

        // Otherwise set a default
        this.message = "Unknown Error";
    }
1025011
public ServerHandle detect(MBeanServerExecutor pMBeanServerExecutor) {
        String serverInfo = getSingleStringAttribute(pMBeanServerExecutor, "*:type=Server", "serverInfo");
        if (serverInfo == null) {
            return null;
        }
        Matcher matcher = SERVER_INFO_PATTERN.matcher(serverInfo);
        if (matcher.matches()) {
            String product = matcher.group(1);
            String version = matcher.group(2);
            // TODO: Extract access URL
            if (product.toLowerCase().contains("tomcat")) {
                return new ServerHandle("Apache","tomcat",version, null);
            }
        }
        return null;
    }
1290321
public static void error(Object obj) {
		if (obj instanceof Throwable) {
			Throwable e = (Throwable) obj;
			error(e, e.getMessage());
		} else {
			error("{}", obj);
		}
	}
82008
public final void warn(Object pObject)
	{
		getLogger().log(FQCN, Level.WARN, pObject, null);
	}
831072
public void errorCommon(String[] msgCodes, Object[] objects) {
        int msgIndex = 0;
        if (!TYPE_ID_TOKEN.equals(this.getTokenType())) {
            msgIndex = 1;
        }
        if (!bInboundSupported) {
            Tr.error(tcCommon, msgCodes[msgIndex], objects);
        }
    }
879299
void handle(final IGPSObject object) {
		if (object instanceof TPVObject) {
			for (final IObjectListener l : this.listeners) {
				l.handleTPV((TPVObject) object);
			}
		} else if (object instanceof SKYObject) {
			for (final IObjectListener l : this.listeners) {
				l.handleSKY((SKYObject) object);
			}
		} else if (object instanceof ATTObject) {
			for (final IObjectListener l : this.listeners) {
				l.handleATT((ATTObject) object);
			}
		} else if (object instanceof SUBFRAMEObject) {
			for (final IObjectListener l : this.listeners) {
				l.handleSUBFRAME((SUBFRAMEObject) object);
			}
		} else if (object instanceof DevicesObject) {
			for (final IObjectListener l : this.listeners) {
				l.handleDevices((DevicesObject) object);
			}
		} else if (object instanceof DeviceObject) {
			for (final IObjectListener l : this.listeners) {
				l.handleDevice((DeviceObject) object);
			}
		} else {
			// object was requested, so put it in the response object
			synchronized (this.asyncWaitMutex) {
				this.asyncResult = object;
				this.asyncWaitMutex.notifyAll();
			}
		}
	}
793391
public ApiResponse<DeleteQueueStatisticResponse> deleteQueueStatisticWithHttpInfo(String object) throws ApiException {
        com.squareup.okhttp.Call call = deleteQueueStatisticValidateBeforeCall(object, null, null);
        Type localVarReturnType = new TypeToken<DeleteQueueStatisticResponse>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }
1255127
private void checkVitalService(final Class service, final Throwable t) {

		if (t != null) {

			logger.error("Vital service {} failed to start with {}, aborting.", service.getSimpleName(), t.getMessage() );
			System.err.println("Vital service " + service.getSimpleName() + " failed to start with " + t.getMessage() + ", aborting.");

		} else {

			logger.error("Vital service {} failed to start, aborting.", service.getSimpleName() );
			System.err.println("Vital service " + service.getSimpleName() + " failed to start, aborting.");

		}
		System.exit(1);
	}
300637
public void verifyCredentials(String username, String password) throws GreenPepperServerException {
        if (username != null && !isCredentialsValid(username, password)) {
            throw new GreenPepperServerException("greenpepper.confluence.badcredentials", "The username and password are incorrect.");
        }
    }
762792
public void prePersist(Object object) {
		Set<Method> methods = getAllMethods(object);
		for (Method method : methods) {
			if (method.isAnnotationPresent(PrePersist.class)) {
			    try {
					method.invoke(object, new Object[] {});
				} catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
					throw new PersistenceException(e);
				}
			    break;
			}
		}
	}
110134
@SuppressWarnings("unchecked") 
   private static void error(Object o, Throwable t)
   {
      if (logging != null)
      {
         try
         {
            Class<?> clz = logging.getClass();
            Method mError = clz.getMethod("error", Object.class, Throwable.class);
            mError.invoke(logging, new Object[] {o, t});
         }
         catch (Throwable th)
         {
            // Nothing we can do
         }
      }
      else
      {
         if (o != null)
            System.out.println(o.toString());

         if (t != null)
            t.printStackTrace(System.out);
      }
   }
970856
public static void assertNull(String message, Object object) {
        if (object == null) {
            return;
        }
        failNotNull(message, object);
    }
122823
private static void handleRpcException(RpcException e, int attemptNumber, String server) throws IOException {
        String messageStart;
        if (!(e.getStatus().equals(RpcStatus.NETWORK_ERROR))) {
            messageStart = "network";
        } else {
            // check whether to retry
            if (attemptNumber + 1 < _maxRetry) {
                return;
            }
            messageStart = "rpc";
        }
        throw new IOException(
                String.format("%s error, server: %s, RPC error: %s", messageStart, server, e.getMessage()), e);
    }
59375
protected void checkType(Object object) {
        if (object == null) {
            throw new NullPointerException("Sequences cannot contain null, use a List instead");
        }
        if (type != null) {
            if (!type.isInstance(object)) {
                throw new IllegalArgumentException(
                        "Invalid type of argument for sequence of type: "
                                + type.getName()
                                + " cannot add object: "
                                + object);
            }
        }
    }
671083
@Override
    public void registerObject(Object object) {
        if (object instanceof ICareWebStartup) {
            startupRoutines.add((ICareWebStartup) object);
        }
    }
183806
public boolean checkResponseForException() {
    if (!finished && rsp != null) {
      Exception e;
      if ((e = rsp.getException()) != null) {
        setError(e.getMessage());
        setFinished();
        return true;
      }
    }
    return false;
  }