• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

supabase / storage / 25639316851

10 May 2026 08:44PM UTC coverage: 74.164% (-0.09%) from 74.255%
25639316851

Pull #1094

github

web-flow
Merge db2c619cb into a4d3fb5c3
Pull Request #1094: feat: embedded vector store

4138 of 6145 branches covered (67.34%)

Branch coverage included in aggregate %.

230 of 301 new or added lines in 7 files covered. (76.41%)

2 existing lines in 1 file now uncovered.

8257 of 10568 relevant lines covered (78.13%)

399.25 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

39.13
/src/storage/protocols/vector/adapter/embedded/error-handler.ts
1
import { ERRORS } from '@internal/errors'
2

3
export type ZVecError = Error & {
4
  code:
5
    | 'ZVEC_NOT_FOUND'
6
    | 'ZVEC_ALREADY_EXISTS'
7
    | 'ZVEC_INVALID_ARGUMENT'
8
    | 'ZVEC_PERMISSION_DENIED'
9
    | 'ZVEC_FAILED_PRECONDITION'
10
    | 'ZVEC_RESOURCE_EXHAUSTED'
11
    | 'ZVEC_UNAVAILABLE'
12
    | 'ZVEC_INTERNAL_ERROR'
13
    | 'ZVEC_NOT_SUPPORTED'
14
    | 'ZVEC_UNKNOWN'
15
    | 'ZVEC_INVALID_STATUS_CODE'
16
}
17

18
function hasZVecCode(error: unknown): error is ZVecError {
19
  return (
1✔
20
    error instanceof Error &&
3✔
21
    typeof (error as ZVecError).code === 'string' &&
22
    (error as ZVecError).code.startsWith('ZVEC_')
23
  )
24
}
25

26
export async function handleZVecError<T>(
27
  fn: () => Promise<T> | T,
28
  resource: { type: string; name: string }
29
): Promise<T> {
30
  try {
11✔
31
    return await fn()
11✔
32
  } catch (e) {
33
    if (!hasZVecCode(e)) {
1!
34
      throw e
1✔
35
    }
36

NEW
37
    switch (e.code) {
×
38
      case 'ZVEC_NOT_FOUND':
NEW
39
        throw ERRORS.S3VectorNotFoundException(resource.type, resource.name)
×
40
      case 'ZVEC_ALREADY_EXISTS':
NEW
41
        throw ERRORS.S3VectorConflictException(resource.type, resource.name)
×
42
      case 'ZVEC_INVALID_ARGUMENT':
NEW
43
        throw ERRORS.InvalidParameter(`${resource.type}:${resource.name}`, { message: e.message })
×
44
      case 'ZVEC_PERMISSION_DENIED':
NEW
45
        throw ERRORS.AccessDenied(e.message, e)
×
46
      case 'ZVEC_NOT_SUPPORTED':
NEW
47
        throw ERRORS.S3VectorEmbeddedNotSupported(`${resource.type}:${resource.name}`)
×
48
      default:
NEW
49
        throw e
×
50
    }
51
  }
52
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc