Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit6c24e3a

Browse files
Thomasrludomikula
Thomasr
authored andcommitted
Add not found exception
1 parenta693103 commit6c24e3a

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

‎server/api-service/lowcoder-sdk/src/main/java/org/lowcoder/sdk/exception/BizError.java‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,10 @@ public enum BizError {
158158
SLUG_INVALID(403,6502),
159159

160160
//flow 6601 - 6601
161-
FLOW_ERROR(500,6601);
161+
FLOW_ERROR(500,6601),
162+
163+
//organization related 6701 - 6701
164+
ORGANIZATION_NOT_FOUND(400,6701);
162165

163166
static {
164167
checkDuplicates(values(),BizError::getBizErrorCode);

‎server/api-service/lowcoder-sdk/src/main/resources/locale_en.properties‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,4 +285,5 @@ DUPLICATE_AUTH_CONFIG_ADDITION=Provider auth type already added to organization
285285
EMAIL_PROVIDER_DISABLED=Email provider is disabled.
286286
SLUG_DUPLICATE_ENTRY=Slug already exists
287287
SLUG_INVALID=Slug format is invalid
288-
FLOW_ERROR=Flow error message: {0}
288+
FLOW_ERROR=Flow error message: {0}
289+
ORGANIZATION_NOT_FOUND=Organization not found.

‎server/api-service/lowcoder-server/src/main/java/org/lowcoder/api/usermanagement/OrganizationController.java‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
importorg.lowcoder.domain.user.service.UserService;
2222
importorg.lowcoder.sdk.config.CommonConfig;
2323
importorg.lowcoder.sdk.constants.WorkspaceMode;
24+
importorg.lowcoder.sdk.exception.BizError;
25+
importorg.lowcoder.sdk.exception.BizException;
2426
importorg.springframework.beans.factory.annotation.Autowired;
2527
importorg.springframework.http.codec.multipart.Part;
2628
importorg.springframework.web.bind.annotation.*;
@@ -186,6 +188,7 @@ public Mono<ResponseView<Organization>> updateSlug(@PathVariable String orgId, @
186188
publicMono<ResponseView<Organization>>getOrganization(@PathVariableStringorgId) {
187189
returngidService.convertOrganizationIdToObjectId(orgId)
188190
.flatMap(id ->organizationService.getById(id))
191+
.switchIfEmpty(Mono.error(newBizException(BizError.ORGANIZATION_NOT_FOUND,"ORGANIZATION_NOT_FOUND")))
189192
.map(ResponseView::success);
190193
}
191194

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp