@@ -630,27 +630,52 @@ export const useAssetAction = () => {
630630 const payload = event . payload as eventPayload ;
631631 const raw = payload . error || "" ;
632632 const lower = raw . toLowerCase ( ) ;
633+ const extractClientPath = ( ) => {
634+ const selectedPathToken = "selected path:" ;
635+ const selectedPathStart = lower . indexOf ( selectedPathToken ) ;
636+ if ( selectedPathStart >= 0 ) {
637+ const valueStart = selectedPathStart + selectedPathToken . length ;
638+ const reasonStart = lower . indexOf ( ", reason:" , valueStart ) ;
639+ const closeStart = lower . indexOf ( ")" , valueStart ) ;
640+ const valueEnd = reasonStart >= 0 ? reasonStart : closeStart >= 0 ? closeStart : raw . length ;
641+ const path = raw . slice ( valueStart , valueEnd ) . trim ( ) ;
642+ if ( path ) return path ;
643+ }
644+
645+ const executableToken = "executable not found:" ;
646+ const executableStart = lower . indexOf ( executableToken ) ;
647+ if ( executableStart >= 0 ) {
648+ const path = raw . slice ( executableStart + executableToken . length ) . trim ( ) ;
649+ if ( path ) return path ;
650+ }
651+
652+ return "" ;
653+ } ;
654+ const withPath = ( base : string ) => {
655+ const path = extractClientPath ( ) ;
656+ return path ? `${ base } \n${ path } ` : base ;
657+ } ;
633658
634659 let description = raw || t ( "ConnectError.ConnectFailed" ) ;
635660
636661 if ( lower . includes ( "executable not found" ) ) {
637- description = t ( "Setting.ExecutableNotFound" ) ;
662+ description = withPath ( t ( "Setting.ExecutableNotFound" ) ) ;
638663 } else if ( lower . includes ( "failed to launch client" ) ) {
639664 description = t ( "ConnectError.ClientLaunchFailed" ) ;
640665 } else if ( lower . includes ( "client process exited" ) ) {
641666 description = t ( "ConnectError.ClientExited" ) ;
642667 } else if ( lower . includes ( "no rdp application" ) ) {
643- description = t ( "ConnectError.RdpAppMissing" ) ;
668+ description = withPath ( t ( "ConnectError.RdpAppMissing" ) ) ;
644669 } else if ( lower . includes ( "no vnc application" ) ) {
645- description = t ( "ConnectError.VncAppMissing" ) ;
670+ description = withPath ( t ( "ConnectError.VncAppMissing" ) ) ;
646671 } else if ( lower . includes ( "no database application" ) ) {
647- description = t ( "ConnectError.DbAppMissing" ) ;
672+ description = withPath ( t ( "ConnectError.DbAppMissing" ) ) ;
648673 } else if ( lower . includes ( "failed to execute rdp application" ) ) {
649- description = t ( "ConnectError.RdpAppFailed" ) ;
674+ description = withPath ( t ( "ConnectError.RdpAppFailed" ) ) ;
650675 } else if ( lower . includes ( "failed to execute vnc application" ) ) {
651- description = t ( "ConnectError.VncAppFailed" ) ;
676+ description = withPath ( t ( "ConnectError.VncAppFailed" ) ) ;
652677 } else if ( lower . includes ( "failed to execute database application" ) ) {
653- description = t ( "ConnectError.DbAppFailed" ) ;
678+ description = withPath ( t ( "ConnectError.DbAppFailed" ) ) ;
654679 }
655680
656681 toast . add ( {
0 commit comments