Skip to content

Conversation

@yashsinghcodes
Copy link
Member

I added logic to return an error message if we get anything in stderr.

I'm unsure whether the result should be marked as success: false or true, since the SSH connection was successful, but the command execution on the remote shell failed.

Also yes, do let me know If I should also return the stdout if there is any when we actually return in this case?

This makes it easier for user to know what went wrong.

@frikky
Copy link
Member

frikky commented Apr 24, 2025

I added logic to return an error message if we get anything in stderr.

I'm unsure whether the result should be marked as success: false or true, since the SSH connection was successful, but the command execution on the remote shell failed.

Also yes, do let me know If I should also return the stdout if there is any when we actually return in this case?

This makes it easier for user to know what went wrong.

Don't return at that point at all, I'd say. STDOUT may still have data, so you just add it as an additional field to the same dictionary (e.g. error_logs).

@frikky
Copy link
Member

frikky commented Apr 30, 2025

bump

@yashsinghcodes
Copy link
Member Author

Hey, sorry — I was off last week. I've made the change.

Copy link
Member

@frikky frikky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(:

return {"success":"false","message":str(e)}

return {"success":"true","output": stdout.read().decode(errors='ignore')}
return {"success":"true","output": stdout.read().decode(errors='ignore'), "error_log": stderr.read().decode(errors='ignore')}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't stderr.read() and stdout.read() be try-caught? Those can easily crash. The decode as well.

@yashsinghcodes
Copy link
Member Author

Sorry, for the delay totally forgot about this, will fix it today.

@yashsinghcodes
Copy link
Member Author

ready for review @frikky

@frikky frikky merged commit 091f4d4 into Shuffle:master Jun 15, 2025
3 of 56 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants