Unified · Split
| @@ -100,9 +100,11 @@ const makeFakeClient = (options?: { · 99 unmodified lines | ||
| 100 | 100 | readonly context: Record<string, string>; |
| 101 | 101 | }) => { |
| 102 | 102 | if (options?.rejectNamesWithColon && name.includes(":")) { |
| 103 | + // oxlint-disable-next-line executor/no-try-catch-or-throw -- boundary: fake WorkOS SDK promise rejects with status-shaped errors | |
| 103 | 104 | throw new FakeInvalidRequestError(`Invalid object name "${name}"`); |
| 104 | 105 | } |
| 105 | 106 | if (objects.has(name)) { |
| 107 | + // oxlint-disable-next-line executor/no-try-catch-or-throw -- boundary: fake WorkOS SDK promise rejects with status-shaped errors | |
| 106 | 108 | throw new FakeConflictError(`Object "${name}" already exists`); |
| 107 | 109 | } |
| 108 | 110 | const id = nextId(); |
| @@ -113,15 +115,18 @@ const makeFakeClient = (options?: { · 4 unmodified lines | ||
| 113 | 115 | |
| 114 | 116 | readObjectByName: async (name: string) => { |
| 115 | 117 | if (options?.rejectNamesWithColon && name.includes(":")) { |
| 118 | + // oxlint-disable-next-line executor/no-try-catch-or-throw -- boundary: fake WorkOS SDK promise rejects with status-shaped errors | |
| 116 | 119 | throw new FakeInvalidRequestError(`Invalid object name "${name}"`); |
| 117 | 120 | } |
| 118 | 121 | if ( |
| 119 | 122 | options?.rejectReadNamesLongerThan !== undefined && |
| 120 | 123 | name.length > options.rejectReadNamesLongerThan |
| 121 | 124 | ) { |
| 125 | + // oxlint-disable-next-line executor/no-try-catch-or-throw -- boundary: fake WorkOS SDK promise rejects with status-shaped errors | |
| 122 | 126 | throw new FakeInvalidRequestError(`Invalid object name "${name}"`); |
| 123 | 127 | } |
| 124 | 128 | const object = objects.get(name); |
| 129 | + // oxlint-disable-next-line executor/no-try-catch-or-throw -- boundary: fake WorkOS SDK promise rejects with status-shaped errors | |
| 125 | 130 | if (!object) throw new FakeNotFoundError(`Object "${name}" not found`); |
| 126 | 131 | return object; |
| 127 | 132 | }, |
| @@ -136,15 +141,18 @@ const makeFakeClient = (options?: { · 8 unmodified lines | ||
| 136 | 141 | readonly versionCheck?: string; |
| 137 | 142 | }) => { |
| 138 | 143 | const current = [...objects.values()].find((o) => o.id === id); |
| 144 | + // oxlint-disable-next-line executor/no-try-catch-or-throw -- boundary: fake WorkOS SDK promise rejects with status-shaped errors | |
| 139 | 145 | if (!current) throw new FakeNotFoundError(`Object "${id}" not found`); |
| 140 | 146 | if ( |
| 141 | 147 | conflictPending && |
| 142 | 148 | current.name.endsWith("/secrets/conflict") |
| 143 | 149 | ) { |
| 144 | 150 | conflictPending = false; |
| 151 | + // oxlint-disable-next-line executor/no-try-catch-or-throw -- boundary: fake WorkOS SDK promise rejects with status-shaped errors | |
| 145 | 152 | throw new FakeConflictError(`Injected conflict for "${id}"`); |
| 146 | 153 | } |
| 147 | 154 | if (versionCheck && current.metadata.versionId !== versionCheck) { |
| 155 | + // oxlint-disable-next-line executor/no-try-catch-or-throw -- boundary: fake WorkOS SDK promise rejects with status-shaped errors | |
| 148 | 156 | throw new FakeConflictError(`Version mismatch for "${id}"`); |
| 149 | 157 | } |
| 150 | 158 | const nextVersion = current.metadata.versionId.replace( |
| @@ -166,6 +174,7 @@ const makeFakeClient = (options?: { · 15 unmodified lines | ||
| 166 | 174 | |
| 167 | 175 | deleteObject: async ({ id }: { readonly id: string }) => { |
| 168 | 176 | const entry = [...objects.entries()].find(([, o]) => o.id === id); |
| 177 | + // oxlint-disable-next-line executor/no-try-catch-or-throw -- boundary: fake WorkOS SDK promise rejects with status-shaped errors | |
| 169 | 178 | if (!entry) throw new FakeNotFoundError(`Object "${id}" not found`); |
| 170 | 179 | objects.delete(entry[0]); |
| 171 | 180 | }, |