Auto-open draft result after foundation completes
This commit is contained in:
@@ -38,6 +38,18 @@ impl AppError {
|
||||
&self.message
|
||||
}
|
||||
|
||||
pub fn body_text(&self) -> String {
|
||||
// 批处理任务不能只读 HTTP 状态文案,否则 DashScope 返回的真实失败原因会被压成“上游服务请求失败”。
|
||||
self.details
|
||||
.as_ref()
|
||||
.and_then(|details| details.get("message"))
|
||||
.and_then(Value::as_str)
|
||||
.map(str::trim)
|
||||
.filter(|message| !message.is_empty())
|
||||
.unwrap_or(self.message.as_str())
|
||||
.to_string()
|
||||
}
|
||||
|
||||
pub fn with_message(mut self, message: impl Into<String>) -> Self {
|
||||
self.message = message.into();
|
||||
self
|
||||
|
||||
Reference in New Issue
Block a user