mirror of
https://github.com/bitwarden/android.git
synced 2025-01-11 18:57:39 +03:00
properly parse error model
This commit is contained in:
parent
113eaef0d1
commit
b67adf8789
1 changed files with 9 additions and 3 deletions
|
@ -27,9 +27,9 @@ namespace Bit.Core.Models.Response
|
||||||
}
|
}
|
||||||
if(errorModel != null)
|
if(errorModel != null)
|
||||||
{
|
{
|
||||||
Message = errorModel.GetValue("Message", StringComparison.OrdinalIgnoreCase)?.Value<string>();
|
var model = errorModel.ToObject<ErrorModel>();
|
||||||
ValidationErrors = errorModel.GetValue("ValidationErrors", StringComparison.OrdinalIgnoreCase)
|
Message = model.Message;
|
||||||
?.Value<Dictionary<string, List<string>>>();
|
ValidationErrors = model.ValidationErrors;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -60,5 +60,11 @@ namespace Bit.Core.Models.Response
|
||||||
}
|
}
|
||||||
return Message;
|
return Message;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private class ErrorModel
|
||||||
|
{
|
||||||
|
public string Message { get; set; }
|
||||||
|
public Dictionary<string, List<string>> ValidationErrors { get; set; }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue