Skip to content

Commit 7813e99

Browse files
committed
docs(errors): document errors
1 parent 6dff067 commit 7813e99

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

docs/Errors.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,11 @@ public void MyMethod() {
2828
public override async Task<IActionResult> PostAsync([FromBody] MyEntity entity)
2929
{
3030
if(_db.IsFull)
31-
return new ObjectResult(new CustomError("507", "Database is full.", "Theres no more room.", "Sorry."));
31+
return Error(new CustomError("507", "Database is full.", "Theres no more room.", "Sorry."));
3232

33+
if(model.Validations.IsValid == false)
34+
return Errors(model.Validations.Select(v => v.GetErrors()));
35+
3336
// ...
3437
}
3538
```

0 commit comments

Comments
 (0)