หมายเหตุ
การเข้าถึงหน้านี้ต้องได้รับการอนุญาต คุณสามารถลอง ลงชื่อเข้าใช้หรือเปลี่ยนไดเรกทอรีได้
การเข้าถึงหน้านี้ต้องได้รับการอนุญาต คุณสามารถลองเปลี่ยนไดเรกทอรีได้
Fails requests with a random selected error from file containing mocked errors.
Configuration example
{
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v2.0.0/rc.schema.json",
"plugins": [
{
"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/v2.0.0/genericrandomerrorplugin.schema.json",
"errorsFile": "errors.json"
}
}
Configuration properties
| Property | Description | Default |
|---|---|---|
errorsFile |
Path to the file that contains error responses. | No default |
rate |
The percentage of requests to fail with a random error. Value between 0 and 100. | 50 |
retryAfterInSeconds |
The number of seconds to wait before retrying the request. Included on the Retry-After response header for dynamic throttling. |
5 |
Command line options
| Name | Description | Default |
|---|---|---|
-f, --failure-rate <failure rate> |
The percentage of requests to fail with a random error. Value between 0 and 100. | 50 |
Next step
ทํางานร่วมกับเราใน GitHub
แหล่งที่มาสำหรับเนื้อหานี้สามารถพบได้บน GitHub ซึ่งคุณยังสามารถสร้างและตรวจสอบปัญหาและคำขอดึงข้อมูลได้ สำหรับข้อมูลเพิ่มเติม ให้ดูคู่มือผู้สนับสนุนของเรา
Dev Proxy