Skip to content

Commit eb8a4dc

Browse files
committed
fix(project): enhance rate limit settings validation and error handling
1 parent ee988fc commit eb8a4dc

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/resolvers/project.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,11 +199,11 @@ module.exports = {
199199
}
200200

201201
// Validate rate limit settings if provided
202-
if (rateLimitSettings !== null && rateLimitSettings !== undefined) {
202+
if (!!rateLimitSettings) {
203203
const { N, T } = rateLimitSettings;
204204

205205
// Validate that N and T exist
206-
if (N === undefined || N === null || T === undefined || T === null) {
206+
if (!N || !T) {
207207
throw new UserInputError(
208208
'Rate limit settings must contain both N (threshold) and T (period) fields.'
209209
);
@@ -245,7 +245,7 @@ module.exports = {
245245
rateLimitSettings: rateLimitSettings || null,
246246
});
247247
} catch (err) {
248-
throw new ApolloError('Something went wrong');
248+
throw new ApolloError('Failed to update project rate limit settings', { originalError: err });
249249
}
250250
},
251251

0 commit comments

Comments
 (0)