all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: "Clément Lassieur" <clement@lassieur.org>
Cc: 31788@debbugs.gnu.org
Subject: [bug#31788] [PATCH] tests: Honor the return value of 'start-service'.
Date: Tue, 12 Jun 2018 21:46:06 +0200	[thread overview]
Message-ID: <87r2lbokjl.fsf@gnu.org> (raw)
In-Reply-To: <20180611220508.17320-1-clement@lassieur.org> ("Clément Lassieur"'s message of "Tue, 12 Jun 2018 00:05:08 +0200")

Hi Clément,

Clément Lassieur <clement@lassieur.org> skribis:

> Since commit dc7b3e56337ee9d8dcd8fe7d5cab71ef536d024f, 'start-service' returns
> the Shepherd's representation of the service as a sexp, and '#f' if the
> service fails to start.  Also, it doesn't throw an exception when the service
> fails to start, so relying on an exception instead of relying on its return
> value is a false positive.

Looking at ‘invoke-action’ (used by ‘start-service’) in (gnu services
herd), it seems that an exception is raised upon error:

      (('reply ('version 0 x ...) ('result y) ('error error)
               ('messages messages))
       (for-each display-message messages)
       (raise-shepherd-error error)
       #f)

There’s one case where an exception isn’t raised, and that’s when
shepherd returns something completely bogus:

      (x
       ;; invalid reply
       #f)

Am I missing something?

Thanks,
Ludo’.

  reply	other threads:[~2018-06-12 19:47 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-11 22:05 [bug#31788] [PATCH] tests: Honor the return value of 'start-service' Clément Lassieur
2018-06-12 19:46 ` Ludovic Courtès [this message]
2018-06-12 20:03   ` Clément Lassieur
2018-06-12 20:38     ` Ludovic Courtès
2018-06-12 20:50       ` Clément Lassieur
2018-06-13  6:51         ` Ludovic Courtès
2018-06-13  7:13           ` bug#31788: " Clément Lassieur

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87r2lbokjl.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=31788@debbugs.gnu.org \
    --cc=clement@lassieur.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.