From 6443700cc3616016932f8633e5330ed5ae40a336 Mon Sep 17 00:00:00 2001 From: Jonathan Gruber Date: Thu, 18 Jan 2024 14:30:22 +0100 Subject: [PATCH] Make error messages more consistent --- package.json | 2 +- src/scrape.ts | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index abd394e..4ca3ec5 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "github-contribution-api", "description": "Scrape contribution data of a Github user", - "version": "4.6.2", + "version": "4.6.3", "author": "Jonathan Gruber ", "license": "MIT", "private": true, diff --git a/src/scrape.ts b/src/scrape.ts index 5027136..baff55b 100644 --- a/src/scrape.ts +++ b/src/scrape.ts @@ -152,11 +152,11 @@ const parseDay = ( }; if (!attr.date) { - throw Error('Unable to parse date attribute.'); + throw Error('Unable to parse contribution date attribute.'); } if (!attr.level) { - throw Error('Unable to parse level attribute.'); + throw Error('Unable to parse contribution level attribute.'); } let count = 0; @@ -236,6 +236,6 @@ export async function scrapeGitHubContributions( export class UserNotFoundError extends Error { constructor(username: string) { - super(`User '${username}' not found`); + super(`User "${username}" not found.`); } }