Hacker Newsnew | past | comments | ask | show | jobs | submit | Eun's commentslogin

Nice! I always wanted to build an XSLT that parses Markdown and outputs HTML, but was lacking the time. That would elevate your blog framework to a wider audience.


then a lot of people would buy it, including me :-)


Can you explain why we should this over https://github.com/pkg/errors?


The README covers the idea behind errtrace in more details, but the primary difference is in what is captured:

pkg/errors captures a stack trace of when the error occurred, and attaches it to the error. This information doesn't change as the error moves through the program.

errtrace captures a 'return trace'--every 'return' statement that the error passes through. This information is appended to at each return site.

This gives you a different view of the code path: the stack trace is the path that led to the error, while the return trace is the path that the error took to get to the user.

The difference is significant because in Go, errors are just plain values that you can store in a struct, pass between goroutines etc. When the error passes to another goroutine, the stack trace from the original goroutine can become less useful in debugging the root cause of the error.

As an example, the Try it out section (https://github.com/bracesdev/errtrace/#try-it-out) in the README includes an example of a semi-realistic program comparing the stack trace and the return trace for the same failure.


How does one go about implementing something like this? I am quite curious.


Judging by the project, it's implemented by instrumenting the source code; either manually modifying error returns with a wrapper function, or by running source files through an automated tool that will find and modify the return statements for you.


I suspect it is based on https://pkg.go.dev/runtime#Caller


At the very least:

>This repository has been archived by the owner on Dec 1, 2021. It is now read-only.

It's largely complete so it is essentially fine at the moment, but it won't be adapted to future language or community changes. A future landmine.


It’s archived mainly because it’s been superseded by fmt.Errorf() with the %w directive. Go 1.20 also introduced errors.Join() and multi-%w which github.com/pkg/errors lack, so using for green field projects is very ill-advised.


Except for the stack trace part, which is a gigantic reason why it was popular.

tbh I'm not sure what the current popular option is for wrapping with stack traces.

Re join: it isn't a joiner-error, it has no need to do anything for that. Just stdlib-join-then-wrap.


It’s pretty easy to write your own Errorf() wrapper or some sort of WithStack() that stores runtime/debug.Stack() output. github.com/pkg/errors offers more flexibility in formatting though.


Well, sure, but by that metric this library is even easier to build yourself since it's only gathering a single stack entry per wrap. And it has no backwards compatibility to worry about.

"You can build X by hand too" has little to do with why people choose to create or use libraries.


> "You can build X by hand too" has little to do with why people choose to create or use libraries.

In my experience, "you can build X by hand" is the Go community's preferred approach.


It's been said that "Go" stands for "Go implement it yourself"


My implementation is about 120 lines, plus about 100 lines of tests. It's not hard, but not trivial either. Doing that for every single project is rather tedious. Especially for prototyping I just quickly want something that 'just works' without fuss.


It would be great if the internals added %W as an option that would also include the relevant trace. Shouldn't be unreasonable or impossible.


Even this package is not needed anymore


How do you get stack traces of errors?


The same way you get stack traces of names, email addresses, random numbers, etc. It is funny how the word 'error' leaves some suddenly forgetting how to write software.


A good internet connection. I had troubles in the past and got a second internet line with LTE. I setup automatic fallback and never had problems since then.


Somebody already developed an obsidian online version? I know that there are plenty but they all use their own database to store the data and not the good old filesystem.


Anyone has an alternative where I can use simple markdown files (in a folder or google drive) as the primary datasource?

I am using obsidian on the Mac, but on the go I have no real solution. (I want to avoid using the obsidian mobile app because it forces you to use Obsidian Sync)


> it forces you to use Obsidian Sync

How so? I use Obsidian on both my laptop and my phone and sync my files using Syncthing. You could probably also use Dropbox something.


You need to use Obsidian Sync if you have an iPhone. IIRC it’s because the third-party storage APIs are limited on iOS in such a way that makes it non-feasible for Obsidian. Something about bulk editing/access.


Obsidian works just fine with iCloud.


demo.logseq.com

It's a web version of the Logseq software, it can import a local folder of MD notes.


Made a watermark tool to watermark images in the browser, using it whenever I send images to third party:

https://github.com/Eun/watermark


I rediscovered my small cli tool that prepends a time to each logline: https://github.com/Eun/logtimer

I ran ping very often and needed to see when exactly the connection dropped.


I don’t see a usecase where a non dev should expose some local resource to the internet. These people don’t run local webservers, nor know how they work.

ngrok is a developer tool. I don’t see why marketing a dev tool to non devs is a good idea, maybe somebody can explain?


What makes this seem like a non-developer tool? You need a server you control, you need to mess with YAML files, "configure Caddy" is one step that's assumed to be easy, etc.


From their docs:

Why? Stable subdomains and SSO are two things too expensive.

Why not just pick one from the Awesome Tunneling? Think broader. Not everyone is a dev who knows about server operations. For people working as community managers, sales, and PMs, booting up something locally could already be a stretch and requiring them to understand how to set up and fix server problems is a waste of team's productivity.

Copy, paste, and run is the best UX for everyone.


It says literally:

> Not everyone is a dev who knows about server operations. For people working as community managers, sales, and PMs, booting up something locally could already be a stretch and requiring them to understand how to set up and fix server problems is a waste of team's productivity.


Oh, I read that as "you can send the links to community managers, sales, and PMs rather than making them run the app locally," since that's like, the main usecase.


Ah could also be, but the whole sentence was like this:

> Why not just pick one from the Awesome Tunneling? Think broader. Not everyone is a dev…

So I read this as targeting non devs.

I think every other alternative from that list also supports common usable links.


I've heard of people wanting remote access to things like Plex or security cameras hosted in their basement. Usually via VPN, but I could see someone using this kind of thing.


funnel is still in alpha stage, you have to join the waitlist to be added to the testers, could take a long time…


There is an invite code on a public tweet by bradfitz:

https://twitter.com/bradfitz/status/1593767530082226176


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: