2 * Copyright (c) 2010-2024 Contributors to the openHAB project
4 * See the NOTICE file(s) distributed with this work for additional
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
11 * SPDX-License-Identifier: EPL-2.0
13 package org.openhab.binding.ecovacs.internal.api;
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.eclipse.jetty.client.api.Response;
19 * @author Danny Baumann - Initial contribution
22 public class EcovacsApiException extends Exception {
23 private static final long serialVersionUID = -5903398729974682356L;
24 public final boolean isAuthFailure;
26 public EcovacsApiException(String reason) {
30 public EcovacsApiException(String reason, boolean isAuthFailure) {
32 this.isAuthFailure = isAuthFailure;
35 public EcovacsApiException(Response response) {
36 super("HTTP status " + response.getStatus());
37 isAuthFailure = response.getStatus() == 401;
40 public EcovacsApiException(Throwable cause) {
44 public EcovacsApiException(Throwable cause, boolean isAuthFailure) {
46 this.isAuthFailure = isAuthFailure;