From 822c2e13d43fc5526ad1ec809cdd61a957f4e518 Mon Sep 17 00:00:00 2001 From: Jesse Gallagher Date: Mon, 11 Mar 2024 16:00:47 -0400 Subject: [PATCH] Add wrapper exception class for ERR_BSAFE_NON_EXISTENT --- .../SecurityItemDoesNotExistException.java | 46 +++++++++++++++++++ .../domino/commons/util/NotesErrorUtils.java | 3 ++ 2 files changed, 49 insertions(+) create mode 100644 domino-jnx-api/src/main/java/com/hcl/domino/exception/SecurityItemDoesNotExistException.java diff --git a/domino-jnx-api/src/main/java/com/hcl/domino/exception/SecurityItemDoesNotExistException.java b/domino-jnx-api/src/main/java/com/hcl/domino/exception/SecurityItemDoesNotExistException.java new file mode 100644 index 00000000..9f9ee6c6 --- /dev/null +++ b/domino-jnx-api/src/main/java/com/hcl/domino/exception/SecurityItemDoesNotExistException.java @@ -0,0 +1,46 @@ +/* + * ========================================================================== + * Copyright (C) 2019-2022 HCL America, Inc. ( http://www.hcl.com/ ) + * All rights reserved. + * ========================================================================== + * Licensed under the Apache License, Version 2.0 (the "License"). You may + * not use this file except in compliance with the License. You may obtain a + * copy of the License at . + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * ========================================================================== + */ +package com.hcl.domino.exception; + +import com.hcl.domino.DominoException; + +/** + * Represents error code 0x172f, "The requested item does not exist" + * + * @author Jesse Gallagher + * @since 1.37.0 + */ +public class SecurityItemDoesNotExistException extends DominoException { + private static final long serialVersionUID = 1L; + + public SecurityItemDoesNotExistException(final int id, final String message) { + super(id, message); + } + + public SecurityItemDoesNotExistException(final int id, final String message, final Throwable cause) { + super(id, message, cause); + } + + public SecurityItemDoesNotExistException(final String msg) { + super(msg); + } + + public SecurityItemDoesNotExistException(final String msg, final Throwable cause) { + super(msg, cause); + } + +} diff --git a/domino-jnx-commons/src/main/java/com/hcl/domino/commons/util/NotesErrorUtils.java b/domino-jnx-commons/src/main/java/com/hcl/domino/commons/util/NotesErrorUtils.java index 74512069..bc3843a4 100644 --- a/domino-jnx-commons/src/main/java/com/hcl/domino/commons/util/NotesErrorUtils.java +++ b/domino-jnx-commons/src/main/java/com/hcl/domino/commons/util/NotesErrorUtils.java @@ -66,6 +66,7 @@ import com.hcl.domino.exception.NoCrossCertificateException; import com.hcl.domino.exception.NotAuthorizedException; import com.hcl.domino.exception.QuitPendingException; +import com.hcl.domino.exception.SecurityItemDoesNotExistException; import com.hcl.domino.exception.ServerNotFoundException; import com.hcl.domino.exception.ServerRestrictedException; import com.hcl.domino.exception.ServerUnavailableException; @@ -321,6 +322,8 @@ public static Optional toNotesError(final short result, final S return Optional.of(new NoCrossCertificateException(s, message)); case INsfErr.ERR_INVALID_NAME: return Optional.of(new InvalidRemotePathnameException(s, message)); + case IBsafeErr.ERR_BSAFE_NON_EXISTENT: + return Optional.of(new SecurityItemDoesNotExistException(s, message)); default: return Optional.of(new DominoException(s, message)); }