File tree Expand file tree Collapse file tree 3 files changed +17
-6
lines changed
Expand file tree Collapse file tree 3 files changed +17
-6
lines changed Original file line number Diff line number Diff line change @@ -88,7 +88,7 @@ impl vite_graph_ser::GetKey for TaskNode {
8888
8989#[ derive( Debug , thiserror:: Error ) ]
9090pub enum TaskGraphLoadError {
91- #[ error( "Failed to load package graph: {0} " ) ]
91+ #[ error( "Failed to load package graph" ) ]
9292 PackageGraphLoadError ( #[ from] vite_workspace:: Error ) ,
9393
9494 #[ error( "Failed to load task config file for package at {package_path:?}" ) ]
Original file line number Diff line number Diff line change @@ -64,12 +64,14 @@ pub struct TaskCallStackDisplay {
6464 frames : Arc < [ TaskCallStackFrameDisplay ] > ,
6565}
6666
67+ impl TaskCallStackDisplay {
68+ pub fn is_empty ( & self ) -> bool {
69+ self . frames . is_empty ( )
70+ }
71+ }
72+
6773impl Display for TaskCallStackDisplay {
6874 fn fmt ( & self , f : & mut std:: fmt:: Formatter < ' _ > ) -> std:: fmt:: Result {
69- if self . frames . is_empty ( ) {
70- write ! ( f, "<empty>" ) ?;
71- return Ok ( ( ) ) ;
72- }
7375 for ( i, frame) in self . frames . iter ( ) . enumerate ( ) {
7476 if i > 0 {
7577 write ! ( f, " -> " ) ?;
Original file line number Diff line number Diff line change @@ -126,14 +126,23 @@ pub enum TaskPlanErrorKind {
126126}
127127
128128#[ derive( Debug , thiserror:: Error ) ]
129- #[ error( "Failed to plan execution, task call stack: {task_call_stack}" ) ]
130129pub struct Error {
131130 task_call_stack : TaskCallStackDisplay ,
132131
133132 #[ source]
134133 kind : TaskPlanErrorKind ,
135134}
136135
136+ impl Display for Error {
137+ fn fmt ( & self , f : & mut std:: fmt:: Formatter < ' _ > ) -> std:: fmt:: Result {
138+ write ! ( f, "Failed to plan execution" ) ?;
139+ if !self . task_call_stack . is_empty ( ) {
140+ write ! ( f, ", task call stack: {}" , self . task_call_stack) ?
141+ }
142+ Ok ( ( ) )
143+ }
144+ }
145+
137146impl TaskPlanErrorKind {
138147 pub fn with_empty_call_stack ( self ) -> Error {
139148 Error { task_call_stack : TaskCallStackDisplay :: default ( ) , kind : self }
You can’t perform that action at this time.
0 commit comments