Skip to content

Commit

Permalink
Callout: Add rate limit syntax sugar
Browse files Browse the repository at this point in the history
  • Loading branch information
jawills authored Dec 15, 2024
1 parent 0e77cc8 commit ce02367
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion force-app/commons/callout/CalloutConditions.cls
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,13 @@ public with sharing class CalloutConditions extends Conditions {
return onStatusCode(401);
}

/**
* Executes when webservice returned 429 Rate Limit
*/
public Condition onRateLimit() {
return onStatusCode(429);
}

/**
* Executes when webservice timed out
*/
Expand Down Expand Up @@ -275,4 +282,4 @@ public with sharing class CalloutConditions extends Conditions {
return false;
}
}
}
}

0 comments on commit ce02367

Please sign in to comment.