Skip to content

Remove inlined request try/catch wrappers in favor of shared error handling #1985

Description

@rappm

Summary

Remove the inlined try { ... } catch (err) { console.error(err); throw err } wrapper from every
query/mutation once the shared axios instance handles logging centrally.

Blocked on prompt-edu/prompt-shared-state#59 (shared request error handling).

What is duplicated (verified, ~130 files)

The identical wrapper across the network layers of assessment (~58), team_allocation (~21),
self_team_allocation (~12), certificate (~5), example (~1):

  • clients/example_component/.../network/queries/getExampleInfo.ts:3
  • clients/assessment_component/.../network/queries/getCoursePhaseParticipations.ts:6

Work

  • After the shared response interceptor lands, strip the try/catch from the ~130 call sites so each
    function is just return (await instance.get/post(url)).data.

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions