mirror of
https://github.com/bitwarden/android.git
synced 2024-12-24 18:08:26 +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)
|
||||
{
|
||||
Message = errorModel.GetValue("Message", StringComparison.OrdinalIgnoreCase)?.Value<string>();
|
||||
ValidationErrors = errorModel.GetValue("ValidationErrors", StringComparison.OrdinalIgnoreCase)
|
||||
?.Value<Dictionary<string, List<string>>>();
|
||||
var model = errorModel.ToObject<ErrorModel>();
|
||||
Message = model.Message;
|
||||
ValidationErrors = model.ValidationErrors;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -60,5 +60,11 @@ namespace Bit.Core.Models.Response
|
|||
}
|
||||
return Message;
|
||||
}
|
||||
|
||||
private class ErrorModel
|
||||
{
|
||||
public string Message { get; set; }
|
||||
public Dictionary<string, List<string>> ValidationErrors { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue