]> git.basschouten.com Git - openhab-addons.git/blob
5b04f63a16092a23d794987123018c74bb70f4a6
[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.freeboxos.internal.api;
14
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.openhab.binding.freeboxos.internal.api.Response.ErrorCode;
17
18 /**
19  * Exception for errors when using the Freebox API
20  *
21  * @author GaĆ«l L'hopital - Initial contribution
22  */
23 @NonNullByDefault
24 public class FreeboxException extends Exception {
25     private static final long serialVersionUID = 9197365222439228186L;
26     private ErrorCode errorCode = ErrorCode.NONE;
27
28     public FreeboxException(String format, Object... args) {
29         super(String.format(format, args));
30     }
31
32     public FreeboxException(Exception cause, String format, Object... args) {
33         super(String.format(format, args), cause);
34     }
35
36     public FreeboxException(ErrorCode errorCode, String message) {
37         this(message);
38         this.errorCode = errorCode;
39     }
40
41     public ErrorCode getErrorCode() {
42         return errorCode;
43     }
44 }