[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/ement 44192614e3: Change/Fix: (ement--json-parse-buffer
From: |
ELPA Syncer |
Subject: |
[elpa] externals/ement 44192614e3: Change/Fix: (ement--json-parse-buffer) Fall back to json-read |
Date: |
Sun, 10 Sep 2023 03:57:49 -0400 (EDT) |
branch: externals/ement
commit 44192614e395e52e9b835abe98f28e03fd661044
Author: Adam Porter <adam@alphapapa.net>
Commit: Adam Porter <adam@alphapapa.net>
Change/Fix: (ement--json-parse-buffer) Fall back to json-read
A user reported that JSON-PARSE-BUFFER signaled this error while
parsing a sync response:
json-parse-error "too big integer near '18446744073407678578'"
I don't know why such a large integer (larger than
most-positive-fixnum on my system) would be in a JSON object returned
by the matrix.org server (the user's homeserver), but I confirmed that
JSON-READ can parse it without error, so we'll fall back to it.
And temporarily we'll have this message when it happens, so I can try
to gauge how often it's happening.
---
ement-lib.el | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/ement-lib.el b/ement-lib.el
index 7b82ecc65f..aaa701ceca 100644
--- a/ement-lib.el
+++ b/ement-lib.el
@@ -99,8 +99,14 @@ that stray such forms don't remain if the function is
removed."
;; TODO: Suggest mentioning in manual and docstrings that `json-read', et al
do not use
;; libjansson, while `json-parse-buffer', et al do.
(if (fboundp 'json-parse-buffer)
- (lambda () (json-parse-buffer :object-type 'alist :null-object nil
- :false-object :json-false))
+ (lambda ()
+ (condition-case err
+ (json-parse-buffer :object-type 'alist :null-object nil
:false-object :json-false)
+ (json-parse-error
+ (ement-message "`json-parse-buffer' signaled `json-parse-error';
falling back to `json-read'... (%S)"
+ (error-message-string err))
+ (goto-char (point-min))
+ (json-read))))
'json-read))
;;;;; Emacs 28 color features.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [elpa] externals/ement 44192614e3: Change/Fix: (ement--json-parse-buffer) Fall back to json-read,
ELPA Syncer <=