JSON::...:Error(3pm)

πŸ“¦
version 0.11 Β· 3 versions
, in debian bookworm, debian trixie, ubuntu jammy, ubuntu noble, ubuntu resolute, ubuntu stonking

🌸 NAME 🌸

okay bestie, say hi to JSON::RPC::Common::Procedure::Return::Version_1_0::Error β€” it's a whole JSON-RPC 1.0 error class, and yes the name is a mouthful, we're not even gonna pretend otherwise πŸ’…


✨ VERSION ✨

this one's at version 0.11, periodt.


πŸŽ€ SYNOPSIS πŸŽ€

like, here's the vibe in one line:

my $return_with_error = $call->return_error("foo");

that's it. that's the whole flex. 🫢


πŸ¦‹ DESCRIPTION πŸ¦‹

okay so here's the tea β˜• β€” JSON-RPC 1.0 literally does not specify what the hell goes in the error field. iconic of them honestly. chaotic. no rules, no notes, just vibes 😭

so, to make 1.0+2.0 server implementations easy, this class shows up as a compatibility layer. it's giving peacekeeper. it's giving bridge. it's giving "i got you bestie" πŸ’–

now for the actual mechanics: inflating a string instantiates an error with an unset code and the string as the message. so the string you feed in? that's the message, no cap. the code stays unset, lowkey just hanging out, unassigned πŸ“

also go look at JSON::RPC::Common::Procedure::Return::Error β€” that's the see-also, iykyk πŸ‘‘

πŸ‘‘ AUTHOR πŸ‘‘

the mastermind behind this is Yuval Kogman <nothingmuch@woobling.org> β€” say thank you, fr fr πŸ™


This software is copyright (c) 2014 by Yuval Kogman and others.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. so yes, you can remix it, you can pass it around, you can do your little thing with it β€” same energy as Perl 5 itself 🌈


and that's a wrap, bestie ✨ this page comes to you via perl v5.30.3, dated 2020-06-23, straight from the User Contributed Perl Documentation collection. mwah, go write some error returns πŸ’‹πŸ’–

πŸ“¦ where this page comes from