mirror of
https://github.com/django/daphne.git
synced 2025-07-12 08:52:18 +03:00
Add non-zero exit code to CLI for startup errors. (#553)
* Add non-zero exit code to CLI for startup errors. * Add missing attribute to mock server. Fixes #552.
This commit is contained in:
parent
b8b4d2a5f7
commit
7cb7253150
|
@ -289,3 +289,5 @@ class CommandLineInterface:
|
||||||
server_name=args.server_name,
|
server_name=args.server_name,
|
||||||
)
|
)
|
||||||
self.server.run()
|
self.server.run()
|
||||||
|
if self.server.abort_start:
|
||||||
|
exit(1)
|
||||||
|
|
|
@ -81,6 +81,8 @@ class TestCLIInterface(TestCase):
|
||||||
Mock server object for testing.
|
Mock server object for testing.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
abort_start = False
|
||||||
|
|
||||||
def __init__(self, **kwargs):
|
def __init__(self, **kwargs):
|
||||||
self.init_kwargs = kwargs
|
self.init_kwargs = kwargs
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user