-
Notifications
You must be signed in to change notification settings - Fork 13k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2964 from alibaba/develop
update version to 1.3.0
- Loading branch information
Showing
277 changed files
with
7,607 additions
and
3,922 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
api/src/main/java/com/alibaba/nacos/api/exception/runtime/NacosDeserializationException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
/* | ||
* Copyright 1999-2018 Alibaba Group Holding Ltd. | ||
* | ||
* 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.alibaba.nacos.api.exception.runtime; | ||
|
||
/** | ||
* Nacos deserialization exception. | ||
* | ||
* @author yangyi | ||
*/ | ||
public class NacosDeserializationException extends NacosRuntimeException { | ||
|
||
public static final int ERROR_CODE = 101; | ||
|
||
private static final long serialVersionUID = -2742350751684273728L; | ||
|
||
private static final String DEFAULT_MSG = "Nacos deserialize failed. "; | ||
|
||
private static final String MSG_FOR_SPECIFIED_CLASS = "Nacos deserialize for class [%s] failed. "; | ||
|
||
private Class<?> targetClass; | ||
|
||
public NacosDeserializationException() { | ||
super(ERROR_CODE); | ||
} | ||
|
||
public NacosDeserializationException(Class<?> targetClass) { | ||
super(ERROR_CODE, String.format(MSG_FOR_SPECIFIED_CLASS, targetClass.getName())); | ||
this.targetClass = targetClass; | ||
} | ||
|
||
public NacosDeserializationException(Throwable throwable) { | ||
super(ERROR_CODE, DEFAULT_MSG, throwable); | ||
} | ||
|
||
public NacosDeserializationException(Class<?> targetClass, Throwable throwable) { | ||
super(ERROR_CODE, String.format(MSG_FOR_SPECIFIED_CLASS, targetClass.getName()), throwable); | ||
this.targetClass = targetClass; | ||
} | ||
|
||
public Class<?> getTargetClass() { | ||
return targetClass; | ||
} | ||
} |
59 changes: 59 additions & 0 deletions
59
api/src/main/java/com/alibaba/nacos/api/exception/runtime/NacosRuntimeException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
/* | ||
* Copyright 1999-2018 Alibaba Group Holding Ltd. | ||
* | ||
* 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.alibaba.nacos.api.exception.runtime; | ||
|
||
/** | ||
* Nacos runtime exception. | ||
* | ||
* @author yangyi | ||
*/ | ||
public class NacosRuntimeException extends RuntimeException { | ||
|
||
private static final long serialVersionUID = 3513491993982293262L; | ||
|
||
public static final String ERROR_MESSAGE_FORMAT = "errCode: %d, errMsg: %s "; | ||
|
||
private int errCode; | ||
|
||
public NacosRuntimeException(int errCode) { | ||
super(); | ||
this.errCode = errCode; | ||
} | ||
|
||
public NacosRuntimeException(int errCode, String errMsg) { | ||
super(String.format(ERROR_MESSAGE_FORMAT, errCode, errMsg)); | ||
this.errCode = errCode; | ||
} | ||
|
||
public NacosRuntimeException(int errCode, Throwable throwable) { | ||
super(throwable); | ||
this.errCode = errCode; | ||
} | ||
|
||
public NacosRuntimeException(int errCode, String errMsg, Throwable throwable) { | ||
super(String.format(ERROR_MESSAGE_FORMAT, errCode, errMsg), throwable); | ||
this.errCode = errCode; | ||
} | ||
|
||
public int getErrCode() { | ||
return errCode; | ||
} | ||
|
||
public void setErrCode(int errCode) { | ||
this.errCode = errCode; | ||
} | ||
} |
57 changes: 57 additions & 0 deletions
57
api/src/main/java/com/alibaba/nacos/api/exception/runtime/NacosSerializationException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
/* | ||
* Copyright 1999-2018 Alibaba Group Holding Ltd. | ||
* | ||
* 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.alibaba.nacos.api.exception.runtime; | ||
|
||
/** | ||
* Nacos serialization exception. | ||
* | ||
* @author yangyi | ||
*/ | ||
public class NacosSerializationException extends NacosRuntimeException { | ||
|
||
public static final int ERROR_CODE = 100; | ||
|
||
private static final long serialVersionUID = -4308536346316915612L; | ||
|
||
private static final String DEFAULT_MSG = "Nacos serialize failed. "; | ||
|
||
private static final String MSG_FOR_SPECIFIED_CLASS = "Nacos serialize for class [%s] failed. "; | ||
|
||
private Class<?> serializedClass; | ||
|
||
public NacosSerializationException() { | ||
super(ERROR_CODE); | ||
} | ||
|
||
public NacosSerializationException(Class<?> serializedClass) { | ||
super(ERROR_CODE, String.format(MSG_FOR_SPECIFIED_CLASS, serializedClass.getName())); | ||
this.serializedClass = serializedClass; | ||
} | ||
|
||
public NacosSerializationException(Throwable throwable) { | ||
super(ERROR_CODE, DEFAULT_MSG, throwable); | ||
} | ||
|
||
public NacosSerializationException(Class<?> serializedClass, Throwable throwable) { | ||
super(ERROR_CODE, String.format(MSG_FOR_SPECIFIED_CLASS, serializedClass.getName()), throwable); | ||
this.serializedClass = serializedClass; | ||
} | ||
|
||
public Class<?> getSerializedClass() { | ||
return serializedClass; | ||
} | ||
} |
Oops, something went wrong.