microsoft / dev-proxy

Dev Proxy is an API simulator that helps you effortlessly test your app beyond the happy path.
https://aka.ms/devproxy
MIT License
471 stars 56 forks source link

--allowed-errors option missing #717

Closed martinlingstuyl closed 3 months ago

martinlingstuyl commented 3 months ago

Type of issue

Code doesn't work

Feedback

The example mentioned in the docs does not work. It appears the option --allowed-errors isn't available. I also don't see it when running devproxy --help

https://learn.microsoft.com/en-us/microsoft-cloud/dev/dev-proxy/how-to/simulate-errors-microsoft-graph-apis#configure-errors-to-simulate

Page URL

https://learn.microsoft.com/en-us/microsoft-cloud/dev/dev-proxy/how-to/simulate-errors-microsoft-graph-apis

Content source URL

https://github.com/MicrosoftDocs/microsoft-cloud/blob/main/docs/dev/dev-proxy/how-to/simulate-errors-microsoft-graph-apis.md

Author

@waldekmastykarz

Document Id

cabe424a-1dbb-fd37-3752-4bc706f1016a

waldekmastykarz commented 3 months ago

Can you share the contents of your devproxyrc.json file?

martinlingstuyl commented 3 months ago

Hi @waldekmastykarz, here it is, but does that matter for a missing option?

{
  "$schema": "https://raw.githubusercontent.com/microsoft/dev-proxy/main/schemas/v0.17.1/rc.schema.json",
  "plugins": [
    {
      "name": "RetryAfterPlugin",
      "enabled": true,
      "pluginPath": "~appFolder/plugins/dev-proxy-plugins.dll"
    },
    {
      "name": "GenericRandomErrorPlugin",
      "enabled": true,
      "pluginPath": "~appFolder/plugins/dev-proxy-plugins.dll",
      "configSection": "genericRandomErrorPlugin"
    }
  ],
  "urlsToWatch": [
    "https://graph.microsoft.com/*",
    "https://jsonplaceholder.typicode.com/*"
  ],
  "genericRandomErrorPlugin": {
    "errorsFile": "devproxy-errors.json"
  },
  "rate": 50,
  "labelMode": "text",
  "logLevel": "information",
  "newVersionNotification": "stable"
}
waldekmastykarz commented 3 months ago

You're using the GenericRandomErrorPlugin. --allowed-errors is specific to the GraphRandomErrorPlugin: https://learn.microsoft.com/en-us/microsoft-cloud/dev/dev-proxy/technical-reference/graphrandomerrorplugin

waldekmastykarz commented 3 months ago

Hi @waldekmastykarz, here it is, but does that matter for a missing option?

A while back, we refactored options, so that plugin-specific options are only exposed, when the corresponding plugin is enabled. Otherwise, you'd get an option that doesn't affect how Dev Proxy work which would be confusing.

martinlingstuyl commented 3 months ago

💡Ah, I see now! Sorry, I've just completely misread this. It turns out there is no issue at all, except between the chair and the screen over here 😅 Let's close this ASAP!

waldekmastykarz commented 3 months ago

All good! Better safe than sorry. Thanks for reaching out