]> git.basschouten.com Git - openhab-addons.git/blob
bc81438905537feb3109962002b711b818cbefe0
[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.mielecloud.internal.webservice.exception;
14
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.eclipse.jdt.annotation.Nullable;
17 import org.openhab.binding.mielecloud.internal.webservice.ConnectionError;
18
19 /**
20  * {@link RuntimeException} thrown if the Miele service is not available or unable to handle requests.
21  *
22  * @author Björn Lange - Initial contribution
23  */
24 @NonNullByDefault
25 public class MieleWebserviceException extends RuntimeException {
26
27     private static final long serialVersionUID = 6268725866086530042L;
28
29     private final ConnectionError connectionError;
30
31     public MieleWebserviceException(final String message, final ConnectionError connectionError) {
32         super(message);
33         this.connectionError = connectionError;
34     }
35
36     public MieleWebserviceException(final String message, @Nullable final Throwable cause,
37             final ConnectionError connectionError) {
38         super(message, cause);
39         this.connectionError = connectionError;
40     }
41
42     public ConnectionError getConnectionError() {
43         return connectionError;
44     }
45 }