diff options
| author | Claude Paroz <claude@2xlibre.net> | 2012-05-26 20:50:44 +0200 |
|---|---|---|
| committer | Claude Paroz <claude@2xlibre.net> | 2012-05-27 20:38:47 +0200 |
| commit | f2b6763ad7cb281ca8699a9c3d532a82f965be4f (patch) | |
| tree | 7fbbb6d1bd00aa9b29b5b8f42e49c3e50cbdc5a0 /docs/howto | |
| parent | 4423757c0c50afbe2470434778c8d5e5b4a70925 (diff) | |
Fixed #18387 -- Do not call sys.exit during call_command.
Moved sys.exit(1) so as failing management commands reach it
only when running from command line.
Diffstat (limited to 'docs/howto')
| -rw-r--r-- | docs/howto/custom-management-commands.txt | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/docs/howto/custom-management-commands.txt b/docs/howto/custom-management-commands.txt index 2b34d35de7..4a27bdf7a9 100644 --- a/docs/howto/custom-management-commands.txt +++ b/docs/howto/custom-management-commands.txt @@ -317,8 +317,12 @@ Exception class indicating a problem while executing a management command. If this exception is raised during the execution of a management -command, it will be caught and turned into a nicely-printed error -message to the appropriate output stream (i.e., stderr); as a -result, raising this exception (with a sensible description of the +command from a command line console, it will be caught and turned into a +nicely-printed error message to the appropriate output stream (i.e., stderr); +as a result, raising this exception (with a sensible description of the error) is the preferred way to indicate that something has gone wrong in the execution of a command. + +If a management command is called from code through +:ref:`call_command <call-command>`, it's up to you to catch the exception +when needed. |
