Skip to content

Commit

Permalink
standardize error message across remote runtime and eventstream runti…
Browse files Browse the repository at this point in the history
…me (#4159)
  • Loading branch information
xingyaoww authored Oct 2, 2024
1 parent 52e0630 commit d518ca0
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions openhands/runtime/client/runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -429,13 +429,15 @@ def run_action(self, action: Action) -> Observation:
logger.debug(f'response: {response}')
error_message = response.text
logger.error(f'Error from server: {error_message}')
obs = ErrorObservation(f'Command execution failed: {error_message}')
obs = ErrorObservation(f'Action execution failed: {error_message}')
except requests.Timeout:
logger.error('No response received within the timeout period.')
obs = ErrorObservation('Command execution timed out')
obs = ErrorObservation(
f'Action execution timed out after {action.timeout} seconds.'
)
except Exception as e:
logger.error(f'Error during command execution: {e}')
obs = ErrorObservation(f'Command execution failed: {str(e)}')
logger.error(f'Error during action execution: {e}')
obs = ErrorObservation(f'Action execution failed: {str(e)}')
self._refresh_logs()
return obs

Expand Down

0 comments on commit d518ca0

Please sign in to comment.