@@ -22,8 +22,7 @@ const renderError = (message, secondaryMessage = "") => {
2222 .small { font: 600 12px 'Segoe UI', Ubuntu, Sans-Serif; fill: #252525 }
2323 .gray { fill: #858585 }
2424 </style>
25- <rect x="0.5" y="0.5" width="${
26- ERROR_CARD_LENGTH - 1
25+ <rect x="0.5" y="0.5" width="${ ERROR_CARD_LENGTH - 1
2726} " height="99%" rx="4.5" fill="#FFFEFE" stroke="#E4E2E2"/>
2827 <text x="25" y="45" class="text">Something went wrong! file an issue at https://tiny.one/readme-stats</text>
2928 <text data-testid="message" x="25" y="55" class="text small">
@@ -288,7 +287,7 @@ const wrapTextMultiline = (text, width = 59, maxLines = 3) => {
288287return multiLineText ;
289288} ;
290289
291- const noop = ( ) => { } ;
290+ const noop = ( ) => { } ;
292291// return console instance based on the environment
293292const logger =
294293process . env . NODE_ENV !== "test" ?console :{ log :noop , error :noop } ;
@@ -310,50 +309,6 @@ const CONSTANTS = {
310309ERROR_CACHE_SECONDS :ERROR_CACHE_SECONDS ,
311310} ;
312311
313- const SECONDARY_ERROR_MESSAGES = {
314- MAX_RETRY :
315- "Please add an env variable called PAT_1 with your github token in vercel" ,
316- USER_NOT_FOUND :"Make sure the provided username is not an organization" ,
317- GRAPHQL_ERROR :"Please try again later" ,
318- } ;
319-
320- /**
321- * Custom error class to handle custom GRS errors.
322- */
323- class CustomError extends Error {
324- /**
325- *@param {string } message Error message.
326- *@param {string } type Error type.
327- */
328- constructor ( message , type ) {
329- super ( message ) ;
330- this . type = type ;
331- this . secondaryMessage = SECONDARY_ERROR_MESSAGES [ type ] || type ;
332- }
333-
334- static MAX_RETRY = "MAX_RETRY" ;
335- static USER_NOT_FOUND = "USER_NOT_FOUND" ;
336- static GRAPHQL_ERROR = "GRAPHQL_ERROR" ;
337- }
338-
339- /**
340- * Missing query parameter class.
341- */
342- class MissingParamError extends Error {
343- /**
344- *@param {string[] } missedParams
345- *@param {string?= } secondaryMessage
346- */
347- constructor ( missedParams , secondaryMessage ) {
348- const msg = `Missing params${ missedParams
349- . map ( ( p ) => `"${ p } "` )
350- . join ( ", " ) } make sure you pass the parameters in URL`;
351- super ( msg ) ;
352- this . missedParams = missedParams ;
353- this . secondaryMessage = secondaryMessage ;
354- }
355- }
356-
357312/**
358313 * Retrieve text length.
359314 *
@@ -451,8 +406,6 @@ export {
451406wrapTextMultiline ,
452407logger ,
453408CONSTANTS ,
454- CustomError ,
455- MissingParamError ,
456409measureText ,
457410lowercaseTrim ,
458411chunkArray ,