Skip to content

Commit

Permalink
chore: do no throw exception
Browse files Browse the repository at this point in the history
  • Loading branch information
arnolanglade committed Oct 30, 2023
1 parent 16d3865 commit beffff7
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions app/api/mikado-graph/mikado-graph.infra.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,16 +67,12 @@ export class SupabaseMikadoGraphs implements MikadoGraphs {
}

async get(id: string): Promise<MikadoGraph> {
const { data, error } = await this.client
const { data } = await this.client
.from('mikado_graph')
.select('aggregate')
.eq('mikado_graph_id', id)
.maybeSingle();

if (error) {
throw new Error('The mikado graph cannot be retrieved', { cause: error });
}

if (!data) {
throw UnknownMikadoGraph.fromId(id);
}
Expand Down

0 comments on commit beffff7

Please sign in to comment.