File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -446,8 +446,16 @@ function getActionLabel(actionType: GenerationAction) {
446446 return actionType .replace (' _' , ' ' );
447447}
448448
449+ function getGenerationFailureGroupKey(actionType : GenerationAction , error : string ) {
450+ const normalizedError = error
451+ .replace (/ Please retry in [\d. ] + s\. ? / g , ' Please retry later.' )
452+ .replace (/ \b \d + \. \d + s\b / g , ' <duration>' )
453+ .replace (/ \b [0-9a-f ] {8} -[0-9a-f ] {4} -[0-9a-f ] {4} -[0-9a-f ] {4} -[0-9a-f ] {12} \b / gi , ' <uuid>' );
454+ return ` ${actionType }:${normalizedError } ` ;
455+ }
456+
449457function registerGenerationFailure(record : RecordState , actionType : GenerationAction , error : string ) {
450- const key = ` ${ actionType }:${ error } ` ;
458+ const key = getGenerationFailureGroupKey ( actionType , error ) ;
451459 let group = generationFailureGroups .get (key );
452460 if (! group ) {
453461 group = {
You can’t perform that action at this time.
0 commit comments