2018-10-03 01:44:11 +00:00
|
|
|
|
using System;
|
2018-07-12 15:07:05 +00:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
|
2018-10-03 01:44:11 +00:00
|
|
|
|
namespace Platform.Dialogflow.Models
|
2018-07-12 15:07:05 +00:00
|
|
|
|
{
|
|
|
|
|
|
public class AIServiceException : Exception
|
|
|
|
|
|
{
|
|
|
|
|
|
public AIResponse Response { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
public AIServiceException()
|
|
|
|
|
|
{
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public AIServiceException(string message) : base(message)
|
|
|
|
|
|
{
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public AIServiceException(string message, Exception innerException) : base(message, innerException)
|
|
|
|
|
|
{
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public AIServiceException(Exception e) : base(e.Message, e)
|
|
|
|
|
|
{
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public AIServiceException(AIResponse response)
|
|
|
|
|
|
{
|
|
|
|
|
|
Response = response;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override string Message
|
|
|
|
|
|
{
|
|
|
|
|
|
get
|
|
|
|
|
|
{
|
|
|
|
|
|
if (Response != null && Response.IsError)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (!string.IsNullOrEmpty(Response.Status.ErrorDetails))
|
|
|
|
|
|
{
|
|
|
|
|
|
return Response.Status.ErrorDetails;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return base.Message;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|