Skip to content

Commit

Permalink
[airq] Improve error handling (#16694)
Browse files Browse the repository at this point in the history
Signed-off-by: Fabian Wolter <github@fabian-wolter.de>
  • Loading branch information
fwolter committed Apr 28, 2024
1 parent 836581e commit 1a727f8
Show file tree
Hide file tree
Showing 4 changed files with 269 additions and 197 deletions.
@@ -0,0 +1,29 @@
/**
* Copyright (c) 2010-2024 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.binding.airq.internal;

import org.eclipse.jdt.annotation.NonNullByDefault;

/**
* Exception for handling an empty response.
*
* @author Fabian Wolter - Initial contribution
*/
@NonNullByDefault
public class AirqEmptyResonseException extends AirqException {
private static final long serialVersionUID = 1423144673651821622L;

public AirqEmptyResonseException() {
super("Device sent an empty response");
}
}
@@ -0,0 +1,41 @@
/**
* Copyright (c) 2010-2024 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.binding.airq.internal;

import org.eclipse.jdt.annotation.NonNullByDefault;

/**
* General exception for this binding.
*
* @author Fabian Wolter - Initial contribution
*/
@NonNullByDefault
public class AirqException extends Exception {
private static final long serialVersionUID = 8255154215873928896L;

public AirqException() {
// nothing
}

public AirqException(String message) {
super(message);
}

public AirqException(Exception exception) {
super(exception);
}

public AirqException(String message, Exception exception) {
super(message, exception);
}
}

0 comments on commit 1a727f8

Please sign in to comment.