Software Engineer β’ Backend & AI Engineering
Software Engineer with 5+ years of experience building scalable backend and distributed systems across domains and AI.
Markdown supported Β· ββ΅ to post
Would love to read more about the advantages and disadvantages of the "go style" error handling.
Zsolt GΓΆmΓΆri
Nice, I dig it! Thanks Bibek Kakati!
Iβd like to chime in with a minor yet potential improvement.
const getData = async () => { try { const result = await methodCall(); return { result }; } catch(error) { return { error }; } } const { result, error } = getData(); if (error) { // β¦ }IMO returning an object (and destructuring both
resultanderror) is way more readable & explicit.