Skip to content

Commit 1a727f8

Browse files
authored
[airq] Improve error handling (openhab#16694)
Signed-off-by: Fabian Wolter <[email protected]>
1 parent 836581e commit 1a727f8

File tree

4 files changed

+269
-197
lines changed

4 files changed

+269
-197
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/**
2+
* Copyright (c) 2010-2024 Contributors to the openHAB project
3+
*
4+
* See the NOTICE file(s) distributed with this work for additional
5+
* information.
6+
*
7+
* This program and the accompanying materials are made available under the
8+
* terms of the Eclipse Public License 2.0 which is available at
9+
* http://www.eclipse.org/legal/epl-2.0
10+
*
11+
* SPDX-License-Identifier: EPL-2.0
12+
*/
13+
package org.openhab.binding.airq.internal;
14+
15+
import org.eclipse.jdt.annotation.NonNullByDefault;
16+
17+
/**
18+
* Exception for handling an empty response.
19+
*
20+
* @author Fabian Wolter - Initial contribution
21+
*/
22+
@NonNullByDefault
23+
public class AirqEmptyResonseException extends AirqException {
24+
private static final long serialVersionUID = 1423144673651821622L;
25+
26+
public AirqEmptyResonseException() {
27+
super("Device sent an empty response");
28+
}
29+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
/**
2+
* Copyright (c) 2010-2024 Contributors to the openHAB project
3+
*
4+
* See the NOTICE file(s) distributed with this work for additional
5+
* information.
6+
*
7+
* This program and the accompanying materials are made available under the
8+
* terms of the Eclipse Public License 2.0 which is available at
9+
* http://www.eclipse.org/legal/epl-2.0
10+
*
11+
* SPDX-License-Identifier: EPL-2.0
12+
*/
13+
package org.openhab.binding.airq.internal;
14+
15+
import org.eclipse.jdt.annotation.NonNullByDefault;
16+
17+
/**
18+
* General exception for this binding.
19+
*
20+
* @author Fabian Wolter - Initial contribution
21+
*/
22+
@NonNullByDefault
23+
public class AirqException extends Exception {
24+
private static final long serialVersionUID = 8255154215873928896L;
25+
26+
public AirqException() {
27+
// nothing
28+
}
29+
30+
public AirqException(String message) {
31+
super(message);
32+
}
33+
34+
public AirqException(Exception exception) {
35+
super(exception);
36+
}
37+
38+
public AirqException(String message, Exception exception) {
39+
super(message, exception);
40+
}
41+
}

0 commit comments

Comments
 (0)