失敗要求,其中包含模擬錯誤的檔案中隨機選取的錯誤。
外掛程式實例定義
{
"name": "GenericRandomErrorPlugin",
"enabled": true,
"pluginPath": "~appFolder/plugins/DevProxy.Plugins.dll",
"configSection": "genericRandomErrorPlugin",
"urlsToWatch": [
"https://api.openai.com/*"
]
}
組態範例
{
"genericRandomErrorPlugin": {
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v0.29.2/genericrandomerrorplugin.schema.json",
"errorsFile": "errors.json"
}
}
組態屬性
財產 |
描述 |
違約 |
errorsFile |
包含錯誤回應之檔案的路徑。 |
無預設值 |
rate |
要求失敗的百分比,並出現隨機錯誤。 介於 0 和 100 之間的值。 |
50 |
retryAfterInSeconds |
重試要求之前要等候的秒數。 包含在動態節流 Retry-After 回應標頭中。 |
5 |
命令行選項
名稱 |
描述 |
違約 |
-f, --failure-rate <failure rate> |
要求失敗的百分比,並出現隨機錯誤。 介於 0 和 100 之間的值。 |
50 |
後續步驟