GNU bug report logs - #48228
json-serialize should signal error when dll is not found [MS Windows]

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Dmitry Gutov <dgutov@HIDDEN>; Keywords: patch; dated Tue, 4 May 2021 15:26:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 4 May 2021 15:25:15 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue May 04 11:25:15 2021
Received: from localhost ([127.0.0.1]:53786 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ldwvD-0000NJ-Cs
	for submit <at> debbugs.gnu.org; Tue, 04 May 2021 11:25:15 -0400
Received: from lists.gnu.org ([209.51.188.17]:49736)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <raaahh@HIDDEN>) id 1ldwvA-0000ND-EG
 for submit <at> debbugs.gnu.org; Tue, 04 May 2021 11:25:14 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:43674)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <raaahh@HIDDEN>) id 1ldwvA-0008Ms-5Z
 for bug-gnu-emacs@HIDDEN; Tue, 04 May 2021 11:25:12 -0400
Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]:40744)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <raaahh@HIDDEN>) id 1ldwv7-0008Q7-Tk
 for bug-gnu-emacs@HIDDEN; Tue, 04 May 2021 11:25:11 -0400
Received: by mail-wr1-x433.google.com with SMTP id d4so9888345wru.7
 for <bug-gnu-emacs@HIDDEN>; Tue, 04 May 2021 08:25:09 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=sender:to:from:subject:message-id:date:user-agent:mime-version
 :content-language:content-transfer-encoding;
 bh=SCeF4VpQuPivlhVLMAE85WUIiDp1VJJ9r490MA1mQjY=;
 b=Mko66Y15bW6qMDdI3u/qgoc9oVOsoKU8QHNccuowjgLpgKdG3VZA/ZvAfWMzceDukj
 WR2xO32fNZJjptC7VyoC48KIkaqmUifjlARZBHcjTFn1sy7DhQ9dt87py1vTsW29re4c
 UGYsUQCD9ixKHIUSwM8LT0wfHEa1mYn6oBi+JLR661J+GerMipz+36P+Cy0sUsvWFmiL
 X/eVljQT3qPFiBdRdqG4eowzD21f6tKUZ9UEjNTOFLsgWSmIPyKYzz99tO9wQ3Fc1K2D
 GB3/tngM7SSvxOMdIOs99kiUdNdIuZD+a/zmxTsu4SXIIoo/JAgjDyItaeGlv6oiN1Og
 FLJg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:sender:to:from:subject:message-id:date
 :user-agent:mime-version:content-language:content-transfer-encoding;
 bh=SCeF4VpQuPivlhVLMAE85WUIiDp1VJJ9r490MA1mQjY=;
 b=HgirmnW779qvMakfqq71M7sB6HnewFZ7gvaLQ2HWX70jtDj3c/G1RN3nFgrcrQEZ2L
 miXXp75bqgagXVOeX3Wd3aSYXZ8d12i77t3bOuOzfHnZ8sgHOpEzGoXZ2l43nY60Tmi4
 DQ0lVUxA2o8PUpOd1Fyxb7pOupU8FqulEq5aKcTOmnNY0V3U7JdQeUWRRV0vso5WkOh0
 ViP3ejnsvJH+h0l8KN1XtvU2FgYfQs3afxxp8hl2aEYK9r+buw1Iv0Wt2SVWAOgXl/vD
 2pqsyEAOEpDHAyAjB1o5WGk90vn9U+h/zwG5NQHYq86L5BxZX1w6TrHFf4uTW6Or0eeV
 fKKg==
X-Gm-Message-State: AOAM531usaNNVHFb+gjG/asmz5++Vv8kwyIJRgcUpdWF50GLwTUPWeJF
 UhoWRGcmj58Z+i9o6K2ADC+61Erh4WI=
X-Google-Smtp-Source: ABdhPJx61BnDyn3MLGwqTJJwOf4UBzlhzoaLg8u6/JIBmYW5u+lKdQfupELeMYUcK7gYkwCXZkw4PA==
X-Received: by 2002:a5d:6da8:: with SMTP id u8mr32372460wrs.48.1620141907872; 
 Tue, 04 May 2021 08:25:07 -0700 (PDT)
Received: from [192.168.0.6] ([46.251.119.176])
 by smtp.googlemail.com with ESMTPSA id u2sm3770680wmm.5.2021.05.04.08.25.06
 for <bug-gnu-emacs@HIDDEN>
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 04 May 2021 08:25:07 -0700 (PDT)
To: bug-gnu-emacs@HIDDEN
From: Dmitry Gutov <dgutov@HIDDEN>
Subject: json-serialize should signal error when dll is not found [MS Windows]
Message-ID: <e2ceedba-9be3-bc61-5c08-85e0be43bb67@HIDDEN>
Date: Tue, 4 May 2021 18:25:05 +0300
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101
 Thunderbird/78.7.1
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 7bit
Received-SPF: pass client-ip=2a00:1450:4864:20::433;
 envelope-from=raaahh@HIDDEN; helo=mail-wr1-x433.google.com
X-Spam_score_int: -14
X-Spam_score: -1.5
X-Spam_bar: -
X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.248,
 FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.248,
 RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=no autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -0.8 (/)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.8 (-)

Tags: patch

As discussed on Emacs Help.

Another commenter suggested signaling a specific error. Please advise 
what to name it and where to put it.

diff --git a/src/json.c b/src/json.c
index 3f1d27ad7f..ece057ae41 100644
--- a/src/json.c
+++ b/src/json.c
@@ -596,8 +596,7 @@ DEFUN ("json-serialize", Fjson_serialize, 
Sjson_serialize, 1, MANY,
      }
    if (!json_initialized)
      {
-      message1 ("jansson library not found");
-      return Qnil;
+      Fsignal (Qerror, list1 (build_unibyte_string ("jansson library 
not found")));
      }
  #endif

@@ -707,8 +706,7 @@ DEFUN ("json-insert", Fjson_insert, Sjson_insert, 1, 
MANY,
      }
    if (!json_initialized)
      {
-      message1 ("jansson library not found");
-      return Qnil;
+      Fsignal (Qerror, list1 (build_unibyte_string ("jansson library 
not found")));
      }
  #endif

@@ -966,8 +964,7 @@ DEFUN ("json-parse-string", Fjson_parse_string, 
Sjson_parse_string, 1, MANY,
      }
    if (!json_initialized)
      {
-      message1 ("jansson library not found");
-      return Qnil;
+      Fsignal (Qerror, list1 (build_unibyte_string ("jansson library 
not found")));
      }
  #endif

@@ -1065,8 +1062,7 @@ DEFUN ("json-parse-buffer", Fjson_parse_buffer, 
Sjson_parse_buffer,
      }
    if (!json_initialized)
      {
-      message1 ("jansson library not found");
-      return Qnil;
+      Fsignal (Qerror, list1 (build_unibyte_string ("jansson library 
not found")));
      }
  #endif




Acknowledgement sent to Dmitry Gutov <dgutov@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#48228; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Tue, 4 May 2021 15:30:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.