Validate the response, the command_status should be 0 otherwise will
throw {@link NegativeResponseException}.

@param response is the response.
@throws NegativeResponseException if the command_status value is not zero.
353274
private static void validateResponse(final Command response) throws NegativeResponseException {
        if (response.getCommandStatus() != SMPPConstant.STAT_ESME_ROK) {
            throw new NegativeResponseException(response.getCommandStatus());
        }
    }
73585
public void removeResponseProp(String key) {
        if (responseProps != null && key != null) {
            responseProps.remove(key);
        }
    }
1196655
public void setResponse(Object response)
    {
        ExternalContext ctx = _MyFacesExternalContextHelper.firstInstance.get();
        
        if (ctx == null)
        {
            throw new UnsupportedOperationException();
        }
        
        ctx.setResponse(response);
    }
1319330
public void setResponse(JsonRpcResponse response) {
    if (response.isError()) {
      setException(response.error());
      return;
    }

    try {
      set((V) Messages.fromJson(method.outputBuilder(), response.result()));
    } catch (Exception e) {
      setException(e);
    }
  }
1167120
private boolean isValid(String response, List<String> options) {

		boolean rslt = false;	// default...

		if (options.size() == 0) {
			// If no acceptable responses are specified, it's wide open...
			rslt = true;
		} else {
			for (String o : options) {
				if (response.matches(o)) {
					rslt = true;
					break;
				}
			}
		}
		
		return rslt;
		
	}
148099
public static boolean isScOk(HttpResponse response) {
        return response != null && response.getStatusLine()!= null &&
                response.getStatusLine().getStatusCode() == HttpStatus.SC_OK;
    }
835994
public void onCommandException(CommandResponse response) {
		String message = I18nProvider.getGlobal().commandError() + ":";
		for (String error : response.getErrorMessages()) {
			message += "\n" + error;
		}
		Log.logWarn(message);
		if (response.getExceptions() == null || response.getExceptions().size() == 0) {
			SC.warn(message);
		} else {
			// The error messaging window only supports 1 exception to display:
			ExceptionWindow window = new ExceptionWindow(response.getExceptions().get(0));
			window.show();
		}
	}
66996
boolean isErrorResponse(HttpResponse response) {
        StatusLine status = response.getStatusLine();
        if (status == null || status.getStatusCode() != 200) {
            return true;
        }
        return false;
    }
705562
public static HttpResponseException throwHttpResponseException(HttpClientResponse response)
    throws IOException
    {
        LOG.warn("Remote service responded to \"%s\" with code %d (cause: %s) %s", response.getUri(), response.getStatusCode(), response.getStatusText(), printData(response));
        throw new HttpResponseException(response);
    }
548280
public void generateError(String response) {
        final String errorInString = extractParameter(response, ERROR_REGEX_PATTERN, true);
        final String errorDescription = extractParameter(response, ERROR_DESCRIPTION_REGEX_PATTERN, false);
        final String errorUriInString = extractParameter(response, ERROR_URI_REGEX_PATTERN, false);
        URI errorUri;
        try {
            errorUri = errorUriInString == null ? null : URI.create(errorUriInString);
        } catch (IllegalArgumentException iae) {
            errorUri = null;
        }

        OAuth2Error errorCode;
        try {
            errorCode = OAuth2Error.parseFrom(errorInString);
        } catch (IllegalArgumentException iaE) {
            //non oauth standard error code
            errorCode = null;
        }

        throw new OAuth2AccessTokenErrorResponse(errorCode, errorDescription, errorUri, response);
    }
451849
protected void sendServerResponse(HttpMessage response) {
        designer.http().server(httpServer).send()
                .response(response.getStatusCode())
                .message(response);
    }
608112
protected boolean shouldResponseBeRecordedAsFailure(final HttpServletResponse response) {
        val status = response.getStatus();
        return status != HttpStatus.SC_CREATED && status != HttpStatus.SC_OK && status != HttpStatus.SC_MOVED_TEMPORARILY;
    }
960318
@Nullable
    public static ApiError parseError(@Nonnull Response<?> response) {
        if (response.isSuccessful()) {
            return null;
        }

        try {
            return parseError(response.errorBody().string(), response.code(), response.message());
        } catch (IOException e) {
            return new ApiError(null, response.code(), "Unknown Error");
        }
    }
759886
function (response) {
            response = JSON.parse(response).result;
            if (response.compilemessage) {
                results.push(response.compilemessage);
                callback({ results: results });
            } else {
                response.stderr.forEach(function (val, index, array) {
                    if (val === false) {
                        if (checker(response.stdout[index], answers[index])) {
                            results.push(true);
                        } else {
                            results.push(false);
                        }
                    } else {
                        results.push(val);
                    }
                });
                callback({
                    results: results,
                    message: response.message,
                    time: response.time,
                    casen: casen
                });
            }
        }
405298
private void processRedirectResponse(Response response) throws RuntimeException, JSONException, MalformedURLException {
        // a valid redirect response must contain the Location header.
        ResponseImpl responseImpl = (ResponseImpl)response;
        List<String> locationHeaders = responseImpl.getHeader(LOCATION_HEADER_NAME);

        String location = (locationHeaders != null && locationHeaders.size() > 0) ? locationHeaders.get(0) : null;

        if (location == null) {
            throw new RuntimeException("Redirect response does not contain 'Location' header.");
        }

        // the redirect location url should contain "wl_result" value in query parameters.
        URL url = new URL(location);
        String query = url.getQuery();

        if (query.contains(WL_RESULT)) {
            String result = Utils.getParameterValueFromQuery(query, WL_RESULT);
            JSONObject jsonResult = new JSONObject(result);

            // process failures if any
            JSONObject jsonFailures = jsonResult.optJSONObject(AUTH_FAILURE_VALUE_NAME);

            if (jsonFailures != null) {
                processFailures(jsonFailures);
                listener.onFailure(response, null, null);
                return;
            }

            // process successes if any
            JSONObject jsonSuccesses = jsonResult.optJSONObject(AUTH_SUCCESS_VALUE_NAME);

            if (jsonSuccesses != null) {
                processSuccesses(jsonSuccesses);
            }
        }

        // the rest is handles by the caller
        listener.onSuccess(response);
    }
196324
void setResponse(HttpResponse response) {
        if (isResponseAborted) {
            // This means that we already tried to close the request, so abort the response immediately.
            if (!response.isComplete()) {
                response.abort();
            }
        } else {
            this.response = response;
        }
    }
220559
protected function verifyResponse($response)
    {
        if (false === $response) {
            throw new BadResponseException('WAMP Server did not respond properly');
        }

        $subres = substr($response, 0, 12);

        if ($subres != 'HTTP/1.1 101') {
            throw new BadResponseException('Unexpected Response. Expected HTTP/1.1 101 got ' . $subres);
        }
    }