anze3db, to random
@anze3db@fosstodon.org avatar

One thing that I'm missing with HTMX and Django is proper error handling.

By default HTMX swallows any response that is not a 2xx, which might leave your users hanging on an endless loading state.

Does anyone have a good solution for this that can be reused between projects?

video/mp4

aral,
@aral@mastodon.ar.al avatar

Also, not immediately relevant to your current issue but something that might be worth considering for the future: using the htmx websocket extension, you can basically implement a streaming HTML approach (example using Kitten: https://ar.al/2024/03/08/streaming-html/) where you can just stream errors to the page as they happen.

(2/2)

dusnm, to random
@dusnm@fosstodon.org avatar

People complain too much about error handling in . Like it or not, go treats errors like any other value. Since the compiler forces you to use all return values of functions, unless you specifically discard the error, you're always aware of which functions can error and that goes a long way to improve the reliability of your software.

Java has checked exceptions, JavaScript trusts you to know that a function 20 slots down the call stack has an unhandled error.

CppCon, to cpp
@CppCon@mastodon.social avatar

We have released a new CppCon 2023 Video!

A Fast, Compliant JSON Pull Parser for Writing Robust Applications – by @foonathan
https://youtu.be/_GrHKyUYyRc

aiono, to random
@aiono@mastodon.social avatar

Great blog post about how to design error handling https://keleshev.com/composable-error-handling-in-ocaml. It specifically talks about OCaml but I think the tradeoffs are valid for any general purpose programming language. The option that author thinks the best is also the same scheme that I considered in the past as the ideal way to denote errors in type signatures.

angelmunoz, to dotnet
@angelmunoz@misskey.cloud avatar

Today in F# bits:

Sometimes when you have a workflow in your system you know in advance that there are some validations and other business rules that may make it fail these are expected errors (not to confuse with exceptions) and are quite cumbersome to handle with exceptions or other error handling techniques, in F# and other languages like rust you have the ability to define that via the Result<value></value> type!
Here we have a simple simulated workflow that may fail or not which will be handled later!

In the second picture we have our Featured F# library from today (link below) which provides a set of helpers and computation expressions that allows us to express these flows in a very convenient way.

https://github.com/demystifyfp/FsToolkit.ErrorHandling

image/png

Jeehut, to random
@Jeehut@iosdev.space avatar

Ever wrote a custom error type in Swift & conformed to ‘Error’?

Don’t: Writing a ‘localizedDescription’ for it won’t work. ❌

Conform to ‘LocalizedError’ instead (even if not localized) & provide an ‘errorDescription’! ✅

Avoid this common pitfall in .

image/jpeg

phillydotnet, to programming

Tackle those C# errors with ease 😎 and say hello to simple error handling and logging with SquidEyes.Fundamentals. While you're at it, why not dip your toes into Web 3.0? Join us at the next meetup. 🙌

https://www.meetup.com/philly-net/events/293263260/

  • All
  • Subscribed
  • Moderated
  • Favorites
  • megavids
  • kavyap
  • thenastyranch
  • mdbf
  • DreamBathrooms
  • InstantRegret
  • magazineikmin
  • Youngstown
  • cisconetworking
  • slotface
  • vwfavf
  • everett
  • Durango
  • rosin
  • tester
  • GTA5RPClips
  • khanakhh
  • osvaldo12
  • ngwrru68w68
  • normalnudes
  • anitta
  • ethstaker
  • cubers
  • modclub
  • tacticalgear
  • provamag3
  • Leos
  • JUstTest
  • All magazines