Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:123920 X-Original-To: internals@lists.php.net Delivered-To: internals@lists.php.net Received: from php-smtp4.php.net (php-smtp4.php.net [45.112.84.5]) by qa.php.net (Postfix) with ESMTPS id 1A4B11ADB6D for ; Thu, 27 Jun 2024 04:10:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1719461486; bh=KWn6Unt92b2A78dcAbhZYNaxSfuJgF0OL28XxS1C0a0=; h=Date:To:From:Cc:Subject:In-Reply-To:References:From; b=Xe7pED/tZylnLCUWQ8Mxexwg8rdOfRpGhAi9dORWsYoStKeHqhE682yNb6K77mKjr HpNcQK9x7ptVcg+0FLP0w+/RUtMdPi6nZ8t9YalhH8loXO8Fts8joaHjtF0RwY2l2S LoopMD84edXDcsm78RZTgAF25KiJr9F4YrBGwCEAd0WKkh3IA6pb6QSD3uxBdBRAPh zxNRRdflX0H903BsaMHoH44+bokSqt3ydiJHSFwzfCt2xfbHQ1zETtTzmd3hrLo8Ox AD1IzGtsvNNUUL8f7X4kd1/7wG88b8HJkhz6+GXOTEjrvfRsCPz97Hgh6wuQ/M0RbO Kwm9bnZhHlddw== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 1CD49180D32 for ; Thu, 27 Jun 2024 04:11:25 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=0.6 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: Error (Cannot connect to unix socket '/var/run/clamav/clamd.ctl': connect: Connection refused) X-Envelope-From: Received: from mail-40136.proton.ch (mail-40136.proton.ch [185.70.40.136]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Thu, 27 Jun 2024 04:11:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gpb.moe; s=protonmail; t=1719461402; x=1719720602; bh=KWn6Unt92b2A78dcAbhZYNaxSfuJgF0OL28XxS1C0a0=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=We0MP1btOZlyhTP/20qVc6PqLHSzTw/2uf56XcgtjyqEBfxkQZFZrAInawqIm21Wi UamYeur6+TKdMa48nWENmkzgOsP2EY8dhMkUzoLnyd03pFWe/Y+qwr0bVL1+kBpX4E 5IiMuqhWiIsV/RA15OdZiLApG1BdnFBSTuAaoap2HZOVRnE+FyheuYZfeg7asFOdWg 6CXaUol+/m1alFeZ0k+vPQOlxvs4stdVFR5m7i+JLMYTM81OdTZA7vkiPJJFOZ1iJU 3zhfPMy4/DIMi+S0xYKFj0NzMBx/wYCrEjvAdwzLenLylAq+Mvdt0YeyUwMOUssV8C sSRZmcxQfsg0A== Date: Thu, 27 Jun 2024 04:09:56 +0000 To: juan carlos morales Cc: PHP Internals List Subject: Re: [PHP-DEV] [RFC][Discussion] Enhance JSON error messages Message-ID: In-Reply-To: References: Feedback-ID: 96993444:user:proton X-Pm-Message-ID: 0ada3ed1e90d8584993c65b1d234a491079c2687 Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: internals@gpb.moe ("Gina P. Banyard") On Wednesday, 26 June 2024 at 15:11, juan carlos morales wrote: > I also think it would be very useful to have better error messages. >=20 > At the moment, we get things like "Syntax Error" ... period, no clue > where the JSON is corrupt or anything else. With big JSONs is very > cumberstone to get to the line and character position where the JSON > is corrupt .... for example. >=20 > I am already working in a change that would improve error messages > while working with JSONs. >=20 > What I am very close to achieve is to have error messages like "Syntax > Error - at character position X near content Y" .... something like > that. >=20 > I already know that I can do it, actually there is a Work In Progress > Pull Request for this : >=20 > https://github.com/php/php-src/pull/14672 >=20 >=20 > I repeat, is work in progress. BUT it can be done. Maybe my approach > is not the best ... but one way or another .... it can be done. >=20 > Please let me know your ideas, thoughts about this. >=20 > Please, dont kill me for the actual code, is WIP. >=20 > Thanks in advance to everyone. >=20 > Juan Hello Juan, I'm in favour of this, but also I do not think this needs an RFC. This is just an enhancement to our current crappy parsing errors, and an RFC feels very much overkill for this. Best regards, Gina P. Banyard