构建指定的错误信息

@param status  错误代码
@param message 错误消息
@param <T>     数据类型
@return 错误消息
557028
public static <T> BaseDTO<T> buildError(String status, String message) {
        BaseDTO<T> dto = new BaseDTO<>();
        dto.status(status, message);
        return dto;
    }
292626
public static ExecutionResult success(String message) {
        ExecutionResult executionResult = new ExecutionResult();
        executionResult.withSuccessMessages(message);
        return executionResult;
    }
573752
public String message(TPSReportStatus status) {
        return status.match(new TPSReportStatus.MatchBlock<String>() {
            @Override
            public String _case(Pending x) {
                return "Pending";
            }

            @Override
            public String _case(Approved x) {
                return "Approved by " + x.approver;
            }

            @Override
            public String _case(Denied x) {
                return "Denied by " + x.rejector;
            }
        });
    }
1139465
static String statusToString(int status)
    {
        String result = null;

        if (status == STATUS_INACTIVE)
        {
            result = "INACTIVE";
        }
        else if (status == STATUS_ACTIVE)
        {
            result = "ACTIVE";
        }
        else if (status == STATUS_KEYPOINTING)
        {
            result = "KEYPOINTING";
        }
        else if (status == STATUS_INVALID)
        {
            result = "INVALID";
        }
        else
        {
            result = "UNKNOWN";
        }

        return result;
    }
719337
static Parser<?> eof(final String message) {
    return new Parser<Object>() {
      @Override boolean apply(ParseContext ctxt) {
        if (ctxt.isEof()) return true;
        ctxt.missing(message);
        return false;
      }
      
      @Override public String toString() {
        return message;
      }
    };
  }
1071016
public Message createReplyMessage(Message message)
    {
        Object objResponseID = ((BaseMessage)message).getMessageHeader().get(TrxMessageHeader.MESSAGE_RESPONSE_ID);
        if (objResponseID == null)
            return null;    // TODO (don) FIX this - return an error.
        MessageProcessInfo recMessageProcessInfo = (MessageProcessInfo)this.getMessageProcessInfo(objResponseID.toString());
        MessageInfo recMessageInfo = (MessageInfo)((ReferenceField)recMessageProcessInfo.getField(MessageProcessInfo.MESSAGE_INFO_ID)).getReference();
        BaseMessage replyMessage = new TreeMessage(null, null);
        MessageRecordDesc messageRecordDesc = recMessageInfo.createNewMessage(replyMessage, null);
        return replyMessage;
    }
401121
private String getMessage(Throwable t) {

        if ((t instanceof I_CmsThrowable) && (((I_CmsThrowable)t).getMessageContainer() != null)) {
            StringBuffer result = new StringBuffer(256);
            if (t instanceof CmsMultiException) {
                CmsMultiException exc = (CmsMultiException)t;
                String message = exc.getMessage(getLocale());
                if (CmsStringUtil.isNotEmpty(message)) {
                    result.append(message);
                    result.append("<br />");
                }

            }

            I_CmsThrowable cmsThrowable = (I_CmsThrowable)t;
            result.append(cmsThrowable.getLocalizedMessage(getLocale()));
            return result.toString();
        } else {
            String message = t.getMessage();
            if (CmsStringUtil.isEmptyOrWhitespaceOnly(message)) {
                // no error message found (e.g. for NPE), provide default message text
                message = CmsVaadinUtils.getMessageText(Messages.GUI_ERROR_UNKNOWN_0);
            }
            return message;
        }
    }
231851
@Override
	public Response checkMessagingConnectionForTheDm( String message ) {

		this.logger.fine( "Request: check the connection to the message queue. message=" + message );
		Response response;
		String lang = lang( this.manager );
		if( this.manager.debugMngr().pingMessageQueue( message ))
			response = handleError( Status.OK, new RestError( REST_DEBUG_AGENT_KO, name( "ECHO" ), value( message )), lang ).build();
		else
			response = handleError( Status.INTERNAL_SERVER_ERROR, new RestError( REST_MESSAGING_ERROR ), lang ).build();

		return response;
	}
1147322
def _set_status(self, status, message=''):
        

        message = message.strip()

        # fetch away message from provided id
        if message.startswith(':'):
            msg_id = message[1:]
            message = self.messages.get(msg_id, '')

        message = message.encode('utf-8', 'replace')

        # attempt to set status for each supported application
        for func in self.set_status_funcs:
            func(status, message)
1177322
public static String getMessage(Throwable t) {

        String message = t.getLocalizedMessage();
        if (message == null) {
            message = t.getMessage();
        }
        if (message == null) {
            message = t.getClass().getName();
        }
        return message;
    }
270698
public static String msgToString(AbstractMessage message)
   {
     if (message == null) return STRING_NULL;
     if (message instanceof JsMessage) return message + "[" + ((JsMessage)message).getSystemMessageId() + "]";
     return message.toString();
   }
968566
public void info(Object message) {
        doLog(Level.INFO, FQCN, message, null, null);
    }
1026140
public static <T extends CharSequence> T notEmpty(final T chars, final String message) {
        return INSTANCE.notEmpty(chars, message);
    }
855566
private void notifyStatus(SmsMessage message) {
        URI callback = message.getStatusCallback();
        if (callback != null) {
            String method = message.getStatusCallbackMethod();
            if (method != null && !method.isEmpty()) {

                if (!org.apache.http.client.methods.HttpGet.METHOD_NAME.equalsIgnoreCase(method)
                        && !org.apache.http.client.methods.HttpPost.METHOD_NAME.equalsIgnoreCase(method)) {
                    final Notification notification = notification(WARNING_NOTIFICATION, 14104, method
                            + " is not a valid HTTP method for <Sms>");
                    storage.getNotificationsDao().addNotification(notification);
                    method = org.apache.http.client.methods.HttpPost.METHOD_NAME;
                }
            } else {
                method = org.apache.http.client.methods.HttpPost.METHOD_NAME;
            }


            List<NameValuePair> parameters = populateReqParams(message);
            HttpRequestDescriptor request = new HttpRequestDescriptor(callback, method, parameters);
            downloader().tell(request, self());

        }
    }
118671
public ApiFuture<String> publish(String message) {
    ByteString data = ByteString.copyFromUtf8(message);
    PubsubMessage pubsubMessage = PubsubMessage.newBuilder().setData(data).build();
    ApiFuture<String> messageIdFuture = publisher.publish(pubsubMessage);
    ApiFutures.addCallback(
        messageIdFuture,
        new ApiFutureCallback<String>() {
          public void onSuccess(String messageId) {
            System.out.println("published with message id: " + messageId);
          }

          public void onFailure(Throwable t) {
            System.out.println("failed to publish: " + t);
          }
        },
        Executors.newSingleThreadExecutor());
    return messageIdFuture;
  }
1075480
public static HealthStatus create(int status, String message, Throwable exception) {
    return new AutoValue_HealthStatus(message, status, Optional.ofNullable(exception));
  }
526840
public function outputJson($data = null, $message = '', $status = 200)
    {
        // 错误信息返回格式可参考：[https://developer.github.com/v3/]
        if ($status != 200 && $message !== '') {
            $data = [
                'message' => $message
            ];
        }
        parent::outputJson($data, $status);
    }