mirror of https://github.com/OpenVidu/openvidu.git
Add generic OpenVidu exception
parent
60a414c791
commit
2fe2cbf9c4
|
@ -4,8 +4,10 @@
|
||||||
|
|
||||||
/target
|
/target
|
||||||
.classpath
|
.classpath
|
||||||
|
.idea
|
||||||
.project
|
.project
|
||||||
.settings
|
.settings
|
||||||
|
*.iml
|
||||||
*orig
|
*orig
|
||||||
.springBeans
|
.springBeans
|
||||||
*tmp/
|
*tmp/
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>openvidu-java-client</artifactId>
|
<artifactId>openvidu-java-client</artifactId>
|
||||||
<version>2.12.1</version>
|
<version>2.13.0</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<name>OpenVidu Java Client</name>
|
<name>OpenVidu Java Client</name>
|
||||||
|
|
|
@ -0,0 +1,33 @@
|
||||||
|
/*
|
||||||
|
* (C) Copyright 2017-2020 OpenVidu (https://openvidu.io)
|
||||||
|
*
|
||||||
|
* 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 io.openvidu.java.client;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Defines a generic OpenVidu exception
|
||||||
|
*/
|
||||||
|
public class OpenViduException extends Exception {
|
||||||
|
|
||||||
|
protected OpenViduException(String message) {
|
||||||
|
super(message);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected OpenViduException(String message, Throwable cause) {
|
||||||
|
super(message, cause);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -20,7 +20,7 @@ package io.openvidu.java.client;
|
||||||
/**
|
/**
|
||||||
* Defines error responses from OpenVidu Server
|
* Defines error responses from OpenVidu Server
|
||||||
*/
|
*/
|
||||||
public class OpenViduHttpException extends Exception {
|
public class OpenViduHttpException extends OpenViduException {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
private int status;
|
private int status;
|
||||||
|
|
|
@ -20,7 +20,7 @@ package io.openvidu.java.client;
|
||||||
/**
|
/**
|
||||||
* Defines unexpected internal errors in OpenVidu Java Client
|
* Defines unexpected internal errors in OpenVidu Java Client
|
||||||
*/
|
*/
|
||||||
public class OpenViduJavaClientException extends Exception {
|
public class OpenViduJavaClientException extends OpenViduException {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,11 @@
|
||||||
|
package io.openvidu.java.client;
|
||||||
|
|
||||||
|
import org.junit.Test;
|
||||||
|
|
||||||
|
public class OpenViduHttpExceptionTest {
|
||||||
|
|
||||||
|
@Test(expected = OpenViduException.class)
|
||||||
|
public void shouldThrowGenericOpenViduException() throws OpenViduHttpException {
|
||||||
|
throw new OpenViduHttpException(401);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,11 @@
|
||||||
|
package io.openvidu.java.client;
|
||||||
|
|
||||||
|
import org.junit.Test;
|
||||||
|
|
||||||
|
public class OpenViduJavaClientExceptionTest {
|
||||||
|
|
||||||
|
@Test(expected = OpenViduException.class)
|
||||||
|
public void shouldThrowGenericOpenViduException() throws OpenViduJavaClientException {
|
||||||
|
throw new OpenViduJavaClientException("message");
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue