private static string GenerateMessageFromError(HiveMPSystemError error)
        {
            var errorCode    = 0;
            var errorMessage = "";
            var errorFields  = "";

            if (error != null)
            {
                errorCode = error.Code ?? 0;
                if (error.Message != null)
                {
                    errorMessage = error.Message;
                }
                if (error.Fields != null)
                {
                    errorFields = error.Fields;
                }
            }
            return("#" + errorCode + ": " + errorMessage + " (" + errorFields + ")");
        }
 public HiveMPException(int httpStatusCode, HiveMPSystemError error)
     : base(GenerateMessageFromError(error))
 {
     HttpStatusCode = httpStatusCode;
     Error          = error;
 }