Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor NotFoundException、BadRequestException #4812

Merged
merged 88 commits into from
Mar 26, 2023
Merged
Show file tree
Hide file tree
Changes from 83 commits
Commits
Show all changes
88 commits
Select commit Hold shift + click to select a range
fe75b4d
add tech-support-qq-4.png
klboke May 16, 2019
99bf97a
Update README.md
klboke May 16, 2019
1579f41
Merge remote-tracking branch 'upstream/master'
klboke Nov 11, 2020
9f65eed
Merge remote-tracking branch 'upstream/master'
klboke Dec 9, 2020
d7d3fd9
Enhance the user experience in the scenario of submitting duplicate keys
klboke Dec 11, 2020
7329fab
Merge branch 'master' into master
nobodyiam Dec 12, 2020
5def448
Modify the key-value conflict exception prompt, adjust the code style
klboke Dec 12, 2020
6942564
Merge branch 'master' into master
nobodyiam Dec 12, 2020
0fc1f91
Merge remote-tracking branch 'upstream/master'
klboke Dec 19, 2020
61ad016
Merge remote-tracking branch 'origin/master'
klboke Dec 19, 2020
587ce33
rge remote-tracking branch 'upstream/master'
klboke Mar 1, 2021
9de6563
Merge remote-tracking branch 'upstream/master'
klboke Mar 8, 2021
9aab632
Merge remote-tracking branch 'upstream/master'
klboke Mar 25, 2021
050dd0a
Merge branch 'ctripcorp:master' into master
klboke May 10, 2021
5a64035
Merge branch 'master' of github.com:klboke/apollo
klboke May 10, 2021
0648fbd
Merge branch 'ctripcorp:master' into master
klboke May 19, 2021
35bd3a6
Merge branch 'master' of github.com:klboke/apollo
klboke May 19, 2021
bc8149b
Merge branch 'ctripcorp:master' into master
klboke Jun 8, 2021
e771bdd
Merge branch 'master' of github.com:klboke/apollo
klboke Jun 8, 2021
9a1ad83
Merge branch 'ctripcorp:master' into master
klboke Jun 25, 2021
3efef37
Merge branch 'master' of github.com:klboke/apollo
klboke Jun 25, 2021
1274281
Merge branch 'apolloconfig:master' into master
klboke Sep 1, 2021
a968932
Merge branch 'master' of github.com:klboke/apollo
klboke Sep 1, 2021
df8942c
Merge branch 'apolloconfig:master' into master
klboke Jan 7, 2022
f98175a
Merge branch 'master' of github.com:klboke/apollo
klboke Jan 7, 2022
710cdd6
Merge branch 'apolloconfig:master' into master
klboke Feb 18, 2022
3c162b6
Merge branch 'master' of github.com:klboke/apollo
klboke Feb 18, 2022
0101a3f
Merge branch 'apolloconfig:master' into master
klboke Jun 17, 2022
cc6f568
Merge branch 'master' of github.com:klboke/apollo
klboke Jun 17, 2022
21dd30c
Merge branch 'apolloconfig:master' into master
klboke Jun 21, 2022
c1eeb41
Merge branch 'master' of github.com:klboke/apollo
klboke Jun 21, 2022
e85d645
Merge branch 'apolloconfig:master' into master
klboke Jun 27, 2022
8b0056d
Merge branch 'master' of github.com:klboke/apollo
klboke Jun 27, 2022
347e07b
Merge branch 'apolloconfig:master' into master
klboke Jul 1, 2022
d8eb437
Merge branch 'master' of github.com:klboke/apollo
klboke Jul 1, 2022
19bae52
Merge branch 'apolloconfig:master' into master
klboke Jul 4, 2022
7e40fa1
Merge branch 'master' of github.com:klboke/apollo
klboke Jul 4, 2022
fbbb02d
Merge branch 'apolloconfig:master' into master
klboke Jul 6, 2022
19cee24
Merge branch 'master' of github.com:klboke/apollo
klboke Jul 6, 2022
91ba3b7
Merge branch 'apolloconfig:master' into master
klboke Jul 8, 2022
94ad542
Merge branch 'master' of github.com:klboke/apollo
klboke Jul 8, 2022
64e1b0b
Merge branch 'apolloconfig:master' into master
klboke Jul 19, 2022
36ce5e2
Merge branch 'master' of github.com:klboke/apollo
klboke Jul 19, 2022
c1364c2
Merge branch 'apolloconfig:master' into master
klboke Jul 22, 2022
76ed2ea
Merge branch 'master' of github.com:klboke/apollo
klboke Jul 22, 2022
db8cf3d
Merge branch 'apolloconfig:master' into master
klboke Jul 26, 2022
3e4616d
Merge branch 'master' of github.com:klboke/apollo
klboke Jul 26, 2022
47297cc
Merge branch 'apolloconfig:master' into master
klboke Jul 30, 2022
1c320e7
Merge branch 'apolloconfig:master' into master
klboke Aug 2, 2022
e723db5
Merge branch 'master' of github.com:klboke/apollo
klboke Aug 2, 2022
6be6a8b
Merge branch 'apolloconfig:master' into master
klboke Aug 8, 2022
014657d
Merge branch 'apolloconfig:master' into master
klboke Aug 12, 2022
370eec9
Merge branch 'master' of github.com:klboke/apollo
klboke Aug 12, 2022
dfa6c54
Merge branch 'apolloconfig:master' into master
klboke Sep 8, 2022
1a66d08
Merge branch 'master' of github.com:klboke/apollo
klboke Sep 8, 2022
cb2c22e
Merge branch 'apolloconfig:master' into master
klboke Sep 14, 2022
74af869
Merge branch 'master' of github.com:klboke/apollo
klboke Sep 14, 2022
a349f2e
Merge branch 'apolloconfig:master' into master
klboke Sep 22, 2022
7238296
Merge branch 'master' of github.com:klboke/apollo
klboke Sep 22, 2022
c38d00d
Merge branch 'apolloconfig:master' into master
klboke Oct 8, 2022
10cbbed
Merge branch 'master' of github.com:klboke/apollo
klboke Oct 8, 2022
601e17b
Merge branch 'apolloconfig:master' into master
klboke Oct 11, 2022
8fe2ce5
Merge branch 'master' of github.com:klboke/apollo
klboke Oct 11, 2022
04ea7ff
Merge branch 'apolloconfig:master' into master
klboke Dec 12, 2022
cfe577c
Merge branch 'master' of github.com:klboke/apollo
klboke Dec 12, 2022
4e9ba79
Merge branch 'apolloconfig:master' into master
klboke Dec 15, 2022
53d033a
Merge branch 'master' of github.com:klboke/apollo
klboke Dec 15, 2022
3789a6d
Merge branch 'apolloconfig:master' into master
klboke Jan 4, 2023
2a1f3bc
Merge branch 'master' of github.com:klboke/apollo
klboke Jan 10, 2023
0c7c63f
Merge branch 'apolloconfig:master' into master
klboke Mar 9, 2023
eaf3b3d
Merge branch 'master' of github.com:klboke/apollo
klboke Mar 9, 2023
312abaa
Merge branch 'apolloconfig:master' into master
klboke Mar 13, 2023
f7c95f2
Merge branch 'master' of github.com:klboke/apollo
klboke Mar 13, 2023
39cc719
Merge branch 'apolloconfig:master' into master
klboke Mar 15, 2023
e410062
Merge branch 'master' of github.com:klboke/apollo
klboke Mar 15, 2023
bb2bf94
Merge branch 'apolloconfig:master' into master
klboke Mar 17, 2023
95cf566
Merge branch 'master' of github.com:klboke/apollo
klboke Mar 17, 2023
0c10b9d
Merge branch 'apolloconfig:master' into master
klboke Mar 20, 2023
aa95cdd
Merge branch 'master' of github.com:klboke/apollo
klboke Mar 20, 2023
3441587
Merge branch 'apolloconfig:master' into master
klboke Mar 21, 2023
a09b174
Merge branch 'master' of github.com:klboke/apollo
klboke Mar 21, 2023
9d6f789
refactor(apollo-common): Refactor NotFoundException
klboke Mar 21, 2023
80c87e6
refactor(apollo-common): Add license
klboke Mar 21, 2023
ba758f4
refactor(apollo-common): Refactor BadRequestException
klboke Mar 22, 2023
dcea183
Merge branch 'master' into eception
nobodyiam Mar 23, 2023
88262a6
refactor(apollo-common): Refactor NotFoundException
klboke Mar 23, 2023
ccc55e4
Merge remote-tracking branch 'origin/eception' into eception
klboke Mar 23, 2023
0fe74cf
Merge branch 'master' into eception
nobodyiam Mar 26, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
import com.ctrip.framework.apollo.biz.service.AppService;
import com.ctrip.framework.apollo.common.dto.AppDTO;
import com.ctrip.framework.apollo.common.entity.App;
import com.ctrip.framework.apollo.common.exception.AppNotFountException;
import com.ctrip.framework.apollo.common.exception.BadRequestException;
import com.ctrip.framework.apollo.common.exception.NotFoundException;
import com.ctrip.framework.apollo.common.utils.BeanUtils;
import com.ctrip.framework.apollo.core.utils.StringUtils;
import org.springframework.data.domain.Pageable;
Expand Down Expand Up @@ -66,7 +66,7 @@ public AppDTO create(@Valid @RequestBody AppDTO dto) {
public void delete(@PathVariable("appId") String appId, @RequestParam String operator) {
App entity = appService.findOne(appId);
if (entity == null) {
throw new NotFoundException("app not found for appId " + appId);
throw new AppNotFountException(appId);
}
adminService.deleteApp(entity, operator);
}
Expand Down Expand Up @@ -96,7 +96,7 @@ public List<AppDTO> find(@RequestParam(value = "name", required = false) String
public AppDTO get(@PathVariable("appId") String appId) {
App app = appService.findOne(appId);
if (app == null) {
throw new NotFoundException("app not found for appId " + appId);
throw new AppNotFountException(appId);
}
return BeanUtils.transform(AppDTO.class, app);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import com.ctrip.framework.apollo.biz.service.ClusterService;
import com.ctrip.framework.apollo.common.dto.ClusterDTO;
import com.ctrip.framework.apollo.common.exception.BadRequestException;
import com.ctrip.framework.apollo.common.exception.NotFoundException;
import com.ctrip.framework.apollo.common.exception.ClusterNotFoundException;
import com.ctrip.framework.apollo.common.utils.BeanUtils;
import com.ctrip.framework.apollo.core.ConfigConsts;
import org.springframework.web.bind.annotation.DeleteMapping;
Expand Down Expand Up @@ -69,7 +69,7 @@ public void delete(@PathVariable("appId") String appId,
Cluster entity = clusterService.findOne(appId, clusterName);

if (entity == null) {
throw new NotFoundException("cluster not found for clusterName " + clusterName);
throw new ClusterNotFoundException(appId, clusterName);
}

if(ConfigConsts.CLUSTER_NAME_DEFAULT.equals(entity.getName())){
Expand All @@ -90,7 +90,7 @@ public ClusterDTO get(@PathVariable("appId") String appId,
@PathVariable("clusterName") String clusterName) {
Cluster cluster = clusterService.findOne(appId, clusterName);
if (cluster == null) {
throw new NotFoundException("cluster not found for name " + clusterName);
throw new ClusterNotFoundException(appId, clusterName);
}
return BeanUtils.transform(ClusterDTO.class, cluster);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import com.ctrip.framework.apollo.common.dto.InstanceDTO;
import com.ctrip.framework.apollo.common.dto.PageDTO;
import com.ctrip.framework.apollo.common.dto.ReleaseDTO;
import com.ctrip.framework.apollo.common.exception.NotFoundException;
import com.ctrip.framework.apollo.common.exception.ReleaseNotFoundException;
import com.ctrip.framework.apollo.common.utils.BeanUtils;
import com.google.common.base.Splitter;
import com.google.common.base.Strings;
Expand Down Expand Up @@ -70,7 +70,7 @@ public PageDTO<InstanceDTO> getByRelease(@RequestParam("releaseId") long release
Pageable pageable) {
Release release = releaseService.findOne(releaseId);
if (release == null) {
throw new NotFoundException("release not found for %s", releaseId);
throw new ReleaseNotFoundException(releaseId);
}
Page<InstanceConfig> instanceConfigsPage = instanceService.findActiveInstanceConfigsByReleaseKey
(release.getReleaseKey(), pageable);
Expand Down Expand Up @@ -123,7 +123,7 @@ public List<InstanceDTO> getByReleasesNotIn(@RequestParam("appId") String appId,
List<Release> releases = releaseService.findByReleaseIds(releaseIdSet);

if (CollectionUtils.isEmpty(releases)) {
throw new NotFoundException("releases not found for %s", releaseIds);
throw new ReleaseNotFoundException(releaseIds);
}

Set<String> releaseKeys = releases.stream().map(Release::getReleaseKey).collect(Collectors
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import com.ctrip.framework.apollo.common.dto.PageDTO;
import com.ctrip.framework.apollo.common.exception.BadRequestException;
import com.ctrip.framework.apollo.common.exception.NotFoundException;
import com.ctrip.framework.apollo.common.exception.NamespaceNotFoundException;
import com.ctrip.framework.apollo.common.utils.BeanUtils;

import org.springframework.data.domain.Page;
Expand Down Expand Up @@ -68,8 +69,7 @@ public void delete(@PathVariable("appId") String appId,
@PathVariable("namespaceName") String namespaceName, @RequestParam String operator) {
Namespace entity = namespaceService.findOne(appId, clusterName, namespaceName);
if (entity == null) {
throw new NotFoundException("namespace not found for %s %s %s", appId, clusterName,
namespaceName);
throw new NamespaceNotFoundException(appId, clusterName, namespaceName);
}

namespaceService.deleteNamespace(entity, operator);
Expand All @@ -86,7 +86,7 @@ public List<NamespaceDTO> find(@PathVariable("appId") String appId,
public NamespaceDTO get(@PathVariable("namespaceId") Long namespaceId) {
Namespace namespace = namespaceService.findOne(namespaceId);
if (namespace == null) {
throw new NotFoundException("namespace not found for %s", namespaceId);
throw new NamespaceNotFoundException(namespaceId);
}
return BeanUtils.transform(NamespaceDTO.class, namespace);
}
Expand All @@ -109,8 +109,7 @@ public NamespaceDTO get(@PathVariable("appId") String appId,
@PathVariable("namespaceName") String namespaceName) {
Namespace namespace = namespaceService.findOne(appId, clusterName, namespaceName);
if (namespace == null) {
throw new NotFoundException("namespace not found for %s %s %s", appId, clusterName,
namespaceName);
throw new NamespaceNotFoundException(appId, clusterName, namespaceName);
}
return BeanUtils.transform(NamespaceDTO.class, namespace);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
import com.ctrip.framework.apollo.common.constants.NamespaceBranchStatus;
import com.ctrip.framework.apollo.common.dto.ItemChangeSets;
import com.ctrip.framework.apollo.common.dto.ReleaseDTO;
import com.ctrip.framework.apollo.common.exception.NotFoundException;
import com.ctrip.framework.apollo.common.exception.NamespaceNotFoundException;
import com.ctrip.framework.apollo.common.exception.ReleaseNotFoundException;
import com.ctrip.framework.apollo.common.utils.BeanUtils;
import com.google.common.base.Splitter;
import org.springframework.data.domain.Pageable;
Expand Down Expand Up @@ -72,7 +73,7 @@ public ReleaseController(
public ReleaseDTO get(@PathVariable("releaseId") long releaseId) {
Release release = releaseService.findOne(releaseId);
if (release == null) {
throw new NotFoundException("release not found for %s", releaseId);
throw new ReleaseNotFoundException(releaseId);
}
return BeanUtils.transform(ReleaseDTO.class, release);
}
Expand Down Expand Up @@ -125,8 +126,7 @@ public ReleaseDTO publish(@PathVariable("appId") String appId,
@RequestParam(name = "isEmergencyPublish", defaultValue = "false") boolean isEmergencyPublish) {
Namespace namespace = namespaceService.findOne(appId, clusterName, namespaceName);
if (namespace == null) {
throw new NotFoundException("Could not find namespace for %s %s %s", appId, clusterName,
namespaceName);
throw new NamespaceNotFoundException(appId, clusterName, namespaceName);
}
Release release = releaseService.publish(namespace, releaseName, releaseComment, operator, isEmergencyPublish);

Expand Down Expand Up @@ -162,8 +162,7 @@ public ReleaseDTO updateAndPublish(@PathVariable("appId") String appId,
@RequestBody ItemChangeSets changeSets) {
Namespace namespace = namespaceService.findOne(appId, clusterName, namespaceName);
if (namespace == null) {
throw new NotFoundException("Could not find namespace for %s %s %s", appId, clusterName,
namespaceName);
throw new NamespaceNotFoundException(appId, clusterName, namespaceName);
}

Release release = releaseService.mergeBranchChangeSetsAndRelease(namespace, branchName, releaseName,
Expand Down Expand Up @@ -214,11 +213,10 @@ public ReleaseDTO publish(@PathVariable("appId") String appId,
@RequestParam(name = "grayDelKeys") Set<String> grayDelKeys){
Namespace namespace = namespaceService.findOne(appId, clusterName, namespaceName);
if (namespace == null) {
throw new NotFoundException("Could not find namespace for %s %s %s", appId, clusterName,
namespaceName);
throw new NamespaceNotFoundException(appId, clusterName, namespaceName);
}

Release release = releaseService.grayDeletionPublish(namespace, releaseName, releaseComment,
Release release = releaseService.grayDeletionPublish(namespace, releaseName, releaseComment,
operator, isEmergencyPublish, grayDelKeys);

//send release message
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import com.ctrip.framework.apollo.biz.entity.Namespace;
import com.ctrip.framework.apollo.biz.repository.ItemRepository;
import com.ctrip.framework.apollo.common.exception.BadRequestException;
import com.ctrip.framework.apollo.common.exception.NotFoundException;
import com.ctrip.framework.apollo.common.exception.NamespaceNotFoundException;
import com.ctrip.framework.apollo.common.utils.BeanUtils;
import com.ctrip.framework.apollo.core.utils.StringUtils;

Expand Down Expand Up @@ -256,8 +256,7 @@ private Namespace findNamespaceByAppIdAndClusterNameAndNamespaceName(String appI
String namespaceName) {
Namespace namespace = namespaceService.findOne(appId, clusterName, namespaceName);
if (namespace == null) {
throw new NotFoundException("namespace not found for appId:%s clusterName:%s namespaceName:%s",
appId, clusterName, namespaceName);
throw new NamespaceNotFoundException(appId, clusterName, namespaceName);
}
return namespace;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import com.ctrip.framework.apollo.common.dto.ItemDTO;
import com.ctrip.framework.apollo.common.exception.BadRequestException;
import com.ctrip.framework.apollo.common.exception.NotFoundException;
import com.ctrip.framework.apollo.common.exception.NamespaceNotFoundException;
import com.ctrip.framework.apollo.common.utils.BeanUtils;
import java.util.List;
import org.springframework.stereotype.Service;
Expand Down Expand Up @@ -62,7 +63,7 @@ public ItemChangeSets updateSet(String appId, String clusterName,
Namespace namespace = namespaceService.findOne(appId, clusterName, namespaceName);

if (namespace == null) {
throw new NotFoundException("Namespace %s not found", namespaceName);
throw new NamespaceNotFoundException(appId, clusterName, namespaceName);
}

String operator = changeSet.getDataChangeLastModifiedBy();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import com.ctrip.framework.apollo.common.dto.ItemChangeSets;
import com.ctrip.framework.apollo.common.exception.BadRequestException;
import com.ctrip.framework.apollo.common.exception.NotFoundException;
import com.ctrip.framework.apollo.common.exception.ReleaseNotFoundException;
import com.ctrip.framework.apollo.common.utils.GrayReleaseRuleItemTransformer;
import com.ctrip.framework.apollo.core.utils.StringUtils;
import com.google.common.base.Strings;
Expand Down Expand Up @@ -460,7 +461,7 @@ private Release createRelease(Namespace namespace, String name, String comment,
public Release rollback(long releaseId, String operator) {
Release release = findOne(releaseId);
if (release == null) {
throw new NotFoundException("release not found");
throw new ReleaseNotFoundException(releaseId);
}
if (release.isAbandoned()) {
throw new BadRequestException("release is not active");
Expand Down Expand Up @@ -503,8 +504,12 @@ public Release rollbackTo(long releaseId, long toReleaseId, String operator) {

Release release = findOne(releaseId);
Release toRelease = findOne(toReleaseId);
if (release == null || toRelease == null) {
throw new NotFoundException("release not found");

if (release == null) {
throw new ReleaseNotFoundException(releaseId);
}
if (toRelease == null) {
throw new ReleaseNotFoundException(toReleaseId);
}
if (release.isAbandoned() || toRelease.isAbandoned()) {
throw new BadRequestException("release is not active");
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/*
* Copyright 2023 Apollo Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package com.ctrip.framework.apollo.common.exception;

/**
* @author kl (http://kailing.pub)
* @since 2023/3/21
*/
public class AppNotFountException extends NotFoundException{

public AppNotFountException(String appId) {
super("app not found for appId:%s", appId);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/*
* Copyright 2023 Apollo Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package com.ctrip.framework.apollo.common.exception;

/**
* @author kl (http://kailing.pub)
* @since 2023/3/21
*/
public class ClusterNotFoundException extends NotFoundException{

public ClusterNotFoundException(String appId, String clusterName) {
super("cluster not found for appId:%s clusterName:%s", appId, clusterName);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
* Copyright 2023 Apollo Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package com.ctrip.framework.apollo.common.exception;

/**
* @author kl (http://kailing.pub)
* @since 2023/3/21
*/
public class NamespaceNotFoundException extends NotFoundException{

public NamespaceNotFoundException(String appId, String clusterName, String namespaceName) {
super("namespace not found for appId:%s clusterName:%s namespaceName:%s", appId, clusterName, namespaceName);
}

public NamespaceNotFoundException(long namespaceId) {
super("namespace not found for namespaceId:%s", namespaceId);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/*
* Copyright 2023 Apollo Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package com.ctrip.framework.apollo.common.exception;

/**
* @author kl (http://kailing.pub)
* @since 2023/3/21
*/
public class ReleaseNotFoundException extends NotFoundException{

public ReleaseNotFoundException(Object releaseId) {
super("release not found for releaseId:%s", releaseId);
}
}
Loading