message: todo: fix error response parsing and set NotFoundError name
diff: @@ -69,7 +69,7 @@ export class TodoClient implements TodoApi {
  error.status = res.status;
  try {
  - const json = await res.json();
  + const json = await res.clone().json();
  if (typeof json?.error?.message !== 'string') {
  throw new Error('invalid error');
  }
  @@ -84,6 +84,9 @@ export class TodoClient implements TodoApi {
  } catch {
  error.message = `Failed to ${action}, status ${res.status}`;
  }
  + if (res.status === 404) {
  + error.name = 'NotFoundError';
  + }
  }
  throw error;
  