/*
* Copyright 2012 Splunk, Inc.
*
* 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* 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.
*/
namespace Splunk
{
using System;
using System.Runtime.Serialization;
///
/// Represents a splunk exception
///
public class SplunkException : Exception, ISerializable
{
///
/// Represents when a job has been submitted to splunk, but has not
/// yet been scheduled to run, so there is no job information available.
///
public static int JOBNOTREADY = 1;
///
/// Represents when a timed operation has reached its timeout value.
///
public static int TIMEOUT = 2;
///
/// Represents when an operation is requested on object that is
/// ambiguously defined due to namespace rules.
///
public static int AMBIGUOUS = 3;
///
/// Initializes a new instance of the
/// class.
///
/// The code
/// The text
public SplunkException(int code, string text)
{
this.Code = code;
this.Text = text;
}
///
/// Gets or sets the exception code.
///
public int Code
{
get; set;
}
///
/// Gets or sets the exception text.
///
private string Text
{
get; set;
}
}
}