From c5e09610f92f5ed0ddda6f5d61b9c5d83aecd9f0 Mon Sep 17 00:00:00 2001 From: Vincent Date: Tue, 31 Oct 2023 13:21:08 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20RemoteDebugSteoKeyEnum=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?Unknown=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/dji/sdk/cloudapi/debug/RemoteDebugStepKeyEnum.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/dji/sdk/cloudapi/debug/RemoteDebugStepKeyEnum.java b/src/main/java/com/dji/sdk/cloudapi/debug/RemoteDebugStepKeyEnum.java index ddeca50..60f99b6 100644 --- a/src/main/java/com/dji/sdk/cloudapi/debug/RemoteDebugStepKeyEnum.java +++ b/src/main/java/com/dji/sdk/cloudapi/debug/RemoteDebugStepKeyEnum.java @@ -59,7 +59,9 @@ public enum RemoteDebugStepKeyEnum { FREE_PUTTER("free_putter", "Free Putter"), - STOP_CHARGE("stop_charge", "Stop charging"); + STOP_CHARGE("stop_charge", "Stop charging"), + + UNKNOWN("unknown","Unknown"); private final String stepKey; @@ -79,10 +81,11 @@ public enum RemoteDebugStepKeyEnum { return message; } + //fix: 提供unknown取代异常 witcom@2023.10.30 @JsonCreator public static RemoteDebugStepKeyEnum find(String stepKey) { return Arrays.stream(values()).filter(stepKeyEnum -> stepKeyEnum.stepKey.equals(stepKey)).findAny() - .orElseThrow(() -> new CloudSDKException(RemoteDebugStepKeyEnum.class,stepKey)); + .orElse(UNKNOWN); } }