Skip to content
This repository has been archived by the owner on Jan 3, 2021. It is now read-only.

Incorrect Custom Error Example #1

Open
jaredcnance opened this issue Apr 24, 2018 · 0 comments
Open

Incorrect Custom Error Example #1

jaredcnance opened this issue Apr 24, 2018 · 0 comments
Labels
error Something isn't working

Comments

@jaredcnance
Copy link
Contributor

https://json-api-dotnet.github.io/#/custom-errors

public class CustomJsonApiException : Error 
{
  public CustomJsonApiException(int status, string title)
  : base(status, title)
  { }

  private const string HELP_DOCS_URI = "https://example.com/errors/";
  public ErrorLink Links => HELP_DOCS_URI + Status;
}

// ...
throw new CustomJsonApiException(401, "You're not allowed to do that.");
        
@jaredcnance jaredcnance added the error Something isn't working label Apr 24, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
error Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant