Skip to content

Commit

Permalink
better handle bad shell pipe
Browse files Browse the repository at this point in the history
  • Loading branch information
thomas-mangin committed Jun 12, 2024
1 parent ef90e3e commit c6da455
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
8 changes: 7 additions & 1 deletion src/exabgp/application/decode.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,4 +119,10 @@ def cmdline(cmdarg):


if __name__ == '__main__':
sys.exit(main())
try:
code = main()
sys.exit(code)
except BrokenPipeError:
# there was a PIPE ( ./sbin/exabgp | command )
# and command does not work as should
sys.exit(1)
8 changes: 7 additions & 1 deletion src/exabgp/application/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,10 @@ def main():


if __name__ == '__main__':
sys.exit(main())
try:
code = main()
sys.exit(code)
except BrokenPipeError:
# there was a PIPE ( ./sbin/exabgp | command )
# and command does not work as should
sys.exit(1)

0 comments on commit c6da455

Please sign in to comment.