Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

95
Views
Where from to import Response Error type in Typescript

Im trying to find the source of Response Error Type. What package should I install to handle such error types


import Error from '??';

export const fetchList = createAsyncThunk(
  'list-get',
  async () => {
    try {
      const response = await doFetch(..);
      return response.data
    } catch (error: Error) {
      if(error.response.status === 0 ){
        doHandling();
      } else
      throw error;
    }
  }
)

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

There is no type to import from. error's type should be unknown, not Error, as we can throw everything.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!