]> git.basschouten.com Git - openhab-addons.git/blob
0aad1d40b88d1408116a56652344db7ed6a74154
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2023 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.gardena.internal.exception;
14
15 import java.io.IOException;
16
17 import org.eclipse.jdt.annotation.NonNullByDefault;
18 import org.eclipse.jdt.annotation.Nullable;
19
20 /**
21  * Exception if something happens in the communication to Gardena smart system.
22  *
23  * @author Gerhard Riegler - Initial contribution
24  */
25 @NonNullByDefault
26 public class GardenaException extends IOException {
27
28     private static final long serialVersionUID = 8568935118878542270L;
29     private int status; // http status
30
31     public GardenaException(String message) {
32         super(message);
33         this.status = -1;
34     }
35
36     public GardenaException(Throwable ex) {
37         super(ex);
38         this.status = -1;
39     }
40
41     public GardenaException(@Nullable String message, Throwable cause) {
42         super(message, cause);
43         this.status = -1;
44     }
45
46     public GardenaException(String message, int status) {
47         super(message);
48         this.status = status;
49     }
50
51     public GardenaException(Throwable ex, int status) {
52         super(ex);
53         this.status = status;
54     }
55
56     public GardenaException(@Nullable String message, Throwable cause, int status) {
57         super(message, cause);
58         this.status = status;
59     }
60
61     public int getStatus() {
62         return this.status;
63     }
64 }