|
2 | 2 |
|
3 | 3 | pragma solidity ^0.8.0; |
4 | 4 |
|
5 | | -// Authorization errors |
6 | | -error Unauthorized(); |
| 5 | +library SchedulerErrors { |
| 6 | + // Authorization errors |
| 7 | + error Unauthorized(); |
7 | 8 |
|
8 | | -// Subscription state errors |
9 | | -error InactiveSubscription(); |
10 | | -error InsufficientBalance(); |
11 | | -error CannotUpdatePermanentSubscription(); |
| 9 | + // Subscription state errors |
| 10 | + error InactiveSubscription(); |
| 11 | + error InsufficientBalance(); |
| 12 | + error CannotUpdatePermanentSubscription(); |
12 | 13 |
|
13 | | -// Price feed errors |
14 | | -error InvalidPriceId(bytes32 providedPriceId, bytes32 expectedPriceId); |
15 | | -error InvalidPriceIdsLength(uint256 providedLength, uint256 expectedLength); |
16 | | -error EmptyPriceIds(); |
17 | | -error TooManyPriceIds(uint256 provided, uint256 maximum); |
18 | | -error DuplicatePriceId(bytes32 priceId); |
19 | | -error PriceSlotMismatch(); |
| 14 | + // Price feed errors |
| 15 | + error InvalidPriceId(bytes32 providedPriceId, bytes32 expectedPriceId); |
| 16 | + error InvalidPriceIdsLength(uint256 providedLength, uint256 expectedLength); |
| 17 | + error EmptyPriceIds(); |
| 18 | + error TooManyPriceIds(uint256 provided, uint256 maximum); |
| 19 | + error DuplicatePriceId(bytes32 priceId); |
| 20 | + error PriceSlotMismatch(); |
20 | 21 |
|
21 | | -// Update criteria errors |
22 | | -error InvalidUpdateCriteria(); |
23 | | -error UpdateConditionsNotMet(); |
24 | | -error TimestampTooOld( |
25 | | - uint256 providedUpdateTimestamp, |
26 | | - uint256 currentTimestamp |
27 | | -); |
28 | | -error TimestampOlderThanLastUpdate( |
29 | | - uint256 providedUpdateTimestamp, |
30 | | - uint256 lastUpdatedAt |
31 | | -); |
| 22 | + // Update criteria errors |
| 23 | + error InvalidUpdateCriteria(); |
| 24 | + error UpdateConditionsNotMet(); |
| 25 | + error TimestampTooOld( |
| 26 | + uint256 providedUpdateTimestamp, |
| 27 | + uint256 currentTimestamp |
| 28 | + ); |
| 29 | + error TimestampOlderThanLastUpdate( |
| 30 | + uint256 providedUpdateTimestamp, |
| 31 | + uint256 lastUpdatedAt |
| 32 | + ); |
32 | 33 |
|
33 | | -// Whitelist errors |
34 | | -error TooManyWhitelistedReaders(uint256 provided, uint256 maximum); |
35 | | -error DuplicateWhitelistAddress(address addr); |
| 34 | + // Whitelist errors |
| 35 | + error TooManyWhitelistedReaders(uint256 provided, uint256 maximum); |
| 36 | + error DuplicateWhitelistAddress(address addr); |
36 | 37 |
|
37 | | -// Payment errors |
38 | | -error KeeperPaymentFailed(); |
| 38 | + // Payment errors |
| 39 | + error KeeperPaymentFailed(); |
| 40 | +} |
0 commit comments