Skip to content

Commit

Permalink
Enhancing debugging
Browse files Browse the repository at this point in the history
Signed-off-by: clinique <gael@lhopital.org>
  • Loading branch information
clinique committed Mar 10, 2023
1 parent 434f950 commit f9f6f7d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import org.openhab.binding.netatmo.internal.api.data.NetatmoConstants.ServiceError;

/**
* The {@link ApiError} models an errored response from API
* The {@link ApiError} models an error response from API
*
* @author Gaël L'hopital - Initial contribution
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ public class NetatmoException extends IOException {
private ServiceError statusCode = ServiceError.UNKNOWN;

public NetatmoException(String format, Object... args) {
super(String.format(format, args));
super(format.formatted(args));
}

public NetatmoException(Exception e, String format, Object... args) {
super(String.format(format, args), e);
super(format.formatted(args), e);
}

public NetatmoException(String message) {
Expand All @@ -54,6 +54,6 @@ public ServiceError getStatusCode() {
String message = super.getMessage();
return message == null ? null
: ServiceError.UNKNOWN.equals(statusCode) ? message
: String.format("Rest call failed: statusCode=%s, message=%s", statusCode, message);
: "Rest call failed: statusCode=%s, message=%s".formatted(statusCode, message);
}
}

0 comments on commit f9f6f7d

Please sign in to comment.