2 * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.yangtools.yang.common;
11 * Representation of an error.
14 public interface RpcError {
16 public enum ErrorSeverity {
21 public enum ErrorType {
23 * Indicates an error occurred during transport of data, eg over the network.
28 * Indicates an error occurred during a remote procedure call.
33 * Indicates an error at a protocol layer, eg if invalid data was passed by the caller.
38 * Indicates an error occurred during internal processing.
44 * Returns the error severity, as determined by the application reporting the error.
46 * @return an {@link ErrorSeverity} enum.
48 ErrorSeverity getSeverity();
51 * Returns a short string that identifies the general type of error condition.
53 * The following outlines suggested values as defined by netconf (<a href="https://tools.ietf.org/html/rfc6241#page-89">RFC 6241</a>):
67 * operation-not-supported
75 * @return a string if available or null otherwise.
80 * Returns a short string that identifies the specific type of error condition as
81 * determined by the application reporting the error.
83 * @return a string if available or null otherwise.
85 String getApplicationTag();
88 * Returns a string suitable for human display that describes the error
91 * @return a message string.
97 * Returns a string containing additional information to provide extended
98 * and/or implementation-specific debugging information.
100 * @return a string if available or null otherwise.
106 * Returns an exception cause.
108 * @return a Throwable if the error was triggered by exception, null otherwise.
110 Throwable getCause();
113 * Returns the conceptual layer at which the error occurred.
115 * @return an {@link ErrorType} enum.
117 ErrorType getErrorType();