Home / Function/ handleErrorCodeUploadErrors() — supabase Function Reference

handleErrorCodeUploadErrors() — supabase Function Reference

Architecture documentation for the handleErrorCodeUploadErrors() function in errorSync.ts from the supabase codebase.

Entity Profile

Dependency Diagram

graph TD
  84384790_01b6_e631_0028_dbfb92612ec2["handleErrorCodeUploadErrors()"]
  14f27b08_0e10_0fcd_c334_5e9fe100ee64["uploadErrorCodes()"]
  14f27b08_0e10_0fcd_c334_5e9fe100ee64 -->|calls| 84384790_01b6_e631_0028_dbfb92612ec2
  6b6adaac_18fc_5147_3872_082ddf2861ce["appendError()"]
  84384790_01b6_e631_0028_dbfb92612ec2 -->|calls| 6b6adaac_18fc_5147_3872_082ddf2861ce
  style 84384790_01b6_e631_0028_dbfb92612ec2 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

apps/docs/resources/error/errorSync.ts lines 69–95

function handleErrorCodeUploadErrors(
  results: Array<Result<boolean, PostgrestError>>,
  errorCodes: Array<{ code: string }>
): [number, MultiError | undefined] {
  return results.reduce(
    ([numberUpsertedRows, error], current, index) => {
      return current.match(
        (wasUpserted) =>
          wasUpserted ? [numberUpsertedRows + 1, error] : [numberUpsertedRows, error],
        (currentError) => [
          numberUpsertedRows,
          (
            error ?? new MultiError('All errors encountered when uploading error codes:')
          ).appendError(
            util.format(
              'Error uploading error code %s: %s',
              errorCodes[index].code,
              currentError.message
            ),
            currentError
          ),
        ]
      )
    },
    [0, undefined] as [number, MultiError | undefined]
  )
}

Subdomains

Called By

Frequently Asked Questions

What does handleErrorCodeUploadErrors() do?
handleErrorCodeUploadErrors() is a function in the supabase codebase.
What does handleErrorCodeUploadErrors() call?
handleErrorCodeUploadErrors() calls 1 function(s): appendError.
What calls handleErrorCodeUploadErrors()?
handleErrorCodeUploadErrors() is called by 1 function(s): uploadErrorCodes.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free