2 * Copyright (c) 2010-2023 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.heos.internal.json.dto;
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.eclipse.jdt.annotation.Nullable;
19 * Error object for containing information about HEOS errors
21 * @author Martin van Wingerden - Initial contribution
24 public class HeosError {
25 public final HeosErrorCode code;
26 private final @Nullable Long systemErrorNumber;
28 HeosError(@Nullable Long errorCode, @Nullable Long systemErrorNumber) {
29 if (errorCode == null) {
30 throw new IllegalArgumentException("Error code not given");
32 this.code = HeosErrorCode.of(errorCode);
33 this.systemErrorNumber = systemErrorNumber;
37 public String toString() {
38 return "HeosError{" + "code=" + code + ", systemErrorNumber=" + systemErrorNumber + '}';