Path: blob/master/src/java.base/share/classes/com/sun/security/ntlm/NTLMException.java
41161 views
/*1* Copyright (c) 2010, 2019, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/2425package com.sun.security.ntlm;2627import java.security.GeneralSecurityException;2829/**30* An NTLM-related Exception31*/32public final class NTLMException extends GeneralSecurityException {33@java.io.Serial34private static final long serialVersionUID = -3298539507906689430L;3536/**37* If the incoming packet is invalid.38*/39public static final int PACKET_READ_ERROR = 1;4041/**42* If the client cannot get a domain value from the server and the43* caller has not provided one.44*/45public static final int NO_DOMAIN_INFO = 2;4647/**48* If the client name is not found on server's user database.49*/50public static final int USER_UNKNOWN = 3;5152/**53* If authentication fails.54*/55public static final int AUTH_FAILED = 4;5657/**58* If an illegal version string is provided.59*/60public static final int BAD_VERSION = 5;6162/**63* Protocol errors.64*/65public static final int PROTOCOL = 6;6667private int errorCode;6869/**70* Constructs an NTLMException object.71* @param errorCode the error code, which can be retrieved by72* the {@link #errorCode() } method.73* @param msg the string message, which can be retrived by74* the {@link Exception#getMessage() } method.75*/76public NTLMException(int errorCode, String msg) {77super(msg);78this.errorCode = errorCode;79}8081/**82* Returns the error code associated with this NTLMException.83* @return the error code84*/85public int errorCode() {86return errorCode;87}88}899091