From: Po Lu Date: Mon, 16 May 2022 07:16:27 +0000 (+0000) Subject: Improve error checking in `haiku-roster-launch' X-Git-Tag: emacs-29.0.90~1910^2~652 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=b8cfe8fa754e3a3d197b785a179e0915ba4f53bf;p=emacs.git Improve error checking in `haiku-roster-launch' * src/haikuselect.c (Fhaiku_roster_launch): Signal error if FILE-OR-TYPE doesn't exist or ARGS does not apply. --- diff --git a/src/haikuselect.c b/src/haikuselect.c index f7618aa4db5..313b26f6ba9 100644 --- a/src/haikuselect.c +++ b/src/haikuselect.c @@ -780,7 +780,11 @@ DEFUN ("haiku-roster-launch", Fhaiku_roster_launch, Shaiku_roster_launch, doc: /* Launch an application associated with FILE-OR-TYPE. Return the process ID of any process created, the symbol `already-running' if ARGS was sent to a program that's already -running, or nil if launching the application failed. +running, or nil if launching the application failed because no +application was found for FILE-OR-TYPE. + +Signal an error if FILE-OR-TYPE is invalid, or if ARGS is a message +but the application doesn't accept messages. FILE-OR-TYPE can either be a string denoting a MIME type, or a list with one argument FILE, denoting a file whose associated application @@ -861,6 +865,9 @@ after it starts. */) make_uint (team_id)); else if (rc == B_ALREADY_RUNNING) return Qalready_running; + else if (rc == B_BAD_VALUE) + signal_error ("Invalid type or bad arguments", + list2 (file_or_type, args)); return SAFE_FREE_UNBIND_TO (depth, Qnil); }