File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -218,12 +218,12 @@ export async function buildToTinybird(
218218 ) ;
219219 }
220220
221- // Helper to format errors
221+ // Helper to format errors - always returns a meaningful string
222222 const formatErrors = ( ) : string => {
223223 if ( body . errors && body . errors . length > 0 ) {
224224 return body . errors . map ( e => {
225225 const prefix = e . filename ? `[${ e . filename } ] ` : '' ;
226- return `${ prefix } ${ e . error } ` ;
226+ return `${ prefix } ${ e . error ?? 'Unknown error' } ` ;
227227 } ) . join ( '\n' ) ;
228228 }
229229 return body . error || `HTTP ${ response . status } : ${ response . statusText } ` ;
Original file line number Diff line number Diff line change @@ -539,8 +539,9 @@ function createCli(): Command {
539539 // Show detailed errors if available
540540 if ( deploy ?. errors && deploy . errors . length > 0 ) {
541541 output . showBuildErrors ( deploy . errors ) ;
542- } else if ( result . error ) {
543- output . error ( result . error ) ;
542+ } else {
543+ const errorMessage = result . error ?? deploy ?. error ;
544+ output . error ( errorMessage ?? "Deploy failed (run with TINYBIRD_DEBUG=1 for more info)" ) ;
544545 }
545546 output . showDeployFailure ( ) ;
546547 process . exit ( 1 ) ;
@@ -730,8 +731,9 @@ function createCli(): Command {
730731 const { deploy } = result ;
731732 if ( deploy ?. errors && deploy . errors . length > 0 ) {
732733 output . showBuildErrors ( deploy . errors ) ;
733- } else if ( result . error ) {
734- output . error ( result . error ) ;
734+ } else {
735+ const errorMessage = result . error ?? deploy ?. error ;
736+ output . error ( errorMessage ?? "Build failed (run with TINYBIRD_DEBUG=1 for more info)" ) ;
735737 }
736738 output . showBuildFailure ( true ) ;
737739 return ;
You can’t perform that action at this time.
0 commit comments