mirror of
https://github.com/michivonah/themepark-assistant.git
synced 2025-12-22 22:16:29 +01:00
add error classes to libs + adjust existing imports #3
This commit is contained in:
parent
6b61bd0df3
commit
6bb5037eae
10 changed files with 27 additions and 10 deletions
|
|
@ -1,5 +1,6 @@
|
|||
import { AttractionImport } from '../types/attraction'
|
||||
import httpRequest from '../lib/http-request'
|
||||
import { FetchError } from '../errors';
|
||||
|
||||
/**
|
||||
* Fetching the attractions from a specified park
|
||||
|
|
@ -25,6 +26,6 @@ export default async function fetchAttractions(
|
|||
return result;
|
||||
}
|
||||
catch(e){
|
||||
throw new Error(`Failed to fetch attractions: ${e}`);
|
||||
throw new FetchError(e, endpoint);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue