Skip to content

Instantly share code, notes, and snippets.

View GAierken's full-sized avatar
🦄
Creating.

Gulgina Arkin GAierken

🦄
Creating.
View GitHub Profile
@GAierken
GAierken / resume.md
Last active October 27, 2020 01:01

Guligena Aierken

g.aierken@gmail.com | Github| LinkedIn | Medium | Portfolio

TECHNICAL SKILLS

JavaScript · React · React Native · Redux · Redux-Saga · Ruby on Rails · SQL(PostgreSQL & SQLite) · HTML · CSS · RESTful API

TECHNICAL PROJECTS

Check Your Weather Weather forecast application - Frontend & Backend | Demo

  • Architected single page frontend with React and Redux, utilized Redux-Saga for networking
  • Enabled seven days weather forecast with One Call API by applying Geocoding API
@odewahn
odewahn / error-handling-with-fetch.md
Last active February 27, 2024 09:56
Processing errors with Fetch API

I really liked @tjvantoll article Handling Failed HTTP Responses With fetch(). The one thing I found annoying with it, though, is that response.statusText always returns the generic error message associated with the error code. Most APIs, however, will generally return some kind of useful, more human friendly message in the body.

Here's a modification that will capture this message. The key is that rather than throwing an error, you just throw the response and then process it in the catch block to extract the message in the body:

fetch("/api/foo")
  .then( response => {
    if (!response.ok) { throw response }
    return response.json()  //we only get here if there is no error
 })