Skip to content

Commit

Permalink
core: services: ardupilot_manager: AbstractRouter: Add better message…
Browse files Browse the repository at this point in the history
… if router fails to start

Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
  • Loading branch information
patrickelectric committed Feb 14, 2024
1 parent 1eed2a6 commit 231f113
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,12 @@ async def start(self, master_endpoint: Endpoint) -> None:

await asyncio.sleep(3) # Non-blocking sleep
if not await self.is_running():
raise MavlinkRouterStartFail("Failed to initialize Mavlink router")
_stdout, _strerr = await self._subprocess.communicate()
stdout = _stdout.decode("utf-8") if _stdout else "No stdout."
stderr = _strerr.decode("utf-8") if _strerr else "No stderr."
output = f"message: stdout: '{stdout}', stderr: '{stderr}'"
returncode = self._subprocess.returncode
raise MavlinkRouterStartFail(f"Failed to initialize Mavlink router, code: {returncode}, {output}")
await self.start_house_keepers()

async def exit(self) -> None:
Expand Down

0 comments on commit 231f113

Please sign in to comment.