@@ -21,6 +21,7 @@ import { emojify } from '../../../emojis';
2121import { Features } from '../../../features' ;
2222import { GitErrorHandling } from '../../../git/commandOptions' ;
2323import {
24+ BlameIgnoreRevsFileError ,
2425 FetchError ,
2526 GitSearchError ,
2627 PullError ,
@@ -1463,19 +1464,24 @@ export class LocalGitProvider implements GitProvider, Disposable {
14631464 const blame = parseGitBlame ( this . container , data , root , await this . getCurrentUser ( root ) ) ;
14641465 return blame ;
14651466 } catch ( ex ) {
1467+ Logger . error ( ex , scope ) ;
1468+
14661469 // Trap and cache expected blame errors
14671470 if ( document . state != null ) {
14681471 const msg = ex ?. toString ( ) ?? '' ;
1469- Logger . debug ( scope , `Cache replace (with empty promise): '${ key } '` ) ;
1472+ Logger . debug ( scope , `Cache replace (with empty promise): '${ key } '; reason= ${ msg } ` ) ;
14701473
14711474 const value : CachedBlame = {
14721475 item : emptyPromise as Promise < GitBlame > ,
14731476 errorMessage : msg ,
14741477 } ;
14751478 document . state . setBlame ( key , value ) ;
1476-
14771479 document . setBlameFailure ( ) ;
14781480
1481+ if ( ex instanceof BlameIgnoreRevsFileError ) {
1482+ void window . showErrorMessage ( ex . friendlyMessage ) ;
1483+ }
1484+
14791485 return emptyPromise as Promise < GitBlame > ;
14801486 }
14811487
@@ -1544,18 +1550,24 @@ export class LocalGitProvider implements GitProvider, Disposable {
15441550 const blame = parseGitBlame ( this . container , data , root , await this . getCurrentUser ( root ) ) ;
15451551 return blame ;
15461552 } catch ( ex ) {
1553+ Logger . error ( ex , scope ) ;
1554+
15471555 // Trap and cache expected blame errors
15481556 if ( document . state != null ) {
15491557 const msg = ex ?. toString ( ) ?? '' ;
1550- Logger . debug ( scope , `Cache replace (with empty promise): '${ key } '` ) ;
1558+ Logger . debug ( scope , `Cache replace (with empty promise): '${ key } '; reason= ${ msg } ` ) ;
15511559
15521560 const value : CachedBlame = {
15531561 item : emptyPromise as Promise < GitBlame > ,
15541562 errorMessage : msg ,
15551563 } ;
15561564 document . state . setBlame ( key , value ) ;
1557-
15581565 document . setBlameFailure ( ) ;
1566+
1567+ if ( ex instanceof BlameIgnoreRevsFileError ) {
1568+ void window . showErrorMessage ( ex . friendlyMessage ) ;
1569+ }
1570+
15591571 return emptyPromise as Promise < GitBlame > ;
15601572 }
15611573
@@ -1575,6 +1587,8 @@ export class LocalGitProvider implements GitProvider, Disposable {
15751587 ) : Promise < GitBlameLine | undefined > {
15761588 if ( document ?. isDirty ) return this . getBlameForLineContents ( uri , editorLine , document . getText ( ) , options ) ;
15771589
1590+ const scope = getLogScope ( ) ;
1591+
15781592 if ( ! options ?. forceSingleLine && this . useCaching ) {
15791593 const blame = await this . getBlame ( uri , document ) ;
15801594 if ( blame == null ) return undefined ;
@@ -1614,7 +1628,12 @@ export class LocalGitProvider implements GitProvider, Disposable {
16141628 commit : first ( blame . commits . values ( ) ) ! ,
16151629 line : blame . lines [ editorLine ] ,
16161630 } ;
1617- } catch {
1631+ } catch ( ex ) {
1632+ Logger . error ( ex , scope ) ;
1633+ if ( ex instanceof BlameIgnoreRevsFileError ) {
1634+ void window . showErrorMessage ( ex . friendlyMessage ) ;
1635+ }
1636+
16181637 return undefined ;
16191638 }
16201639 }
0 commit comments