forgejo-contrib/forgejo-cli
20
407
Fork
You've already forked forgejo-cli
51

better error printing #112

Open
opened 2024年08月08日 06:35:33 +02:00 by Cyborus · 18 comments
Member
Copy link

Currently the errors are just base eyre reports. this could be a lot nicer

Currently the errors are just base `eyre` reports. this could be a lot nicer
Contributor
Copy link

Hey,

could I take on this task?

I'm currently on my way of using/learning Rust and thought that might be a good opportunity to use what I've learned from the rust book and other resources. Only if you don't mind of course.

Hey, could I take on this task? I'm currently on my way of using/learning Rust and thought that might be a good opportunity to use what I've learned from the rust book and other resources. Only if you don't mind of course.
Author
Member
Copy link

Absolutely welcome to take a shot at it!

Absolutely welcome to take a shot at it!
Contributor
Copy link

That is great to hear. 👍

Your initial message is not very clear about the issue.

Could you explain in more detail what you are trying to achieve and perhaps give a brief example?

That is great to hear. 👍 Your initial message is not very clear about the issue. Could you explain in more detail what you are trying to achieve and perhaps give a brief example?
Author
Member
Copy link

I haven't put a lot of thought into the details of what I'd like in it yet. In general, I'd like it to do the following:

  • Be more clear when the user has done something incorrectly, and when something else is going wrong.
  • If the user has some something incorrect, it should do what it can to direct them to fixing it.
  • Prettier display, i.e. colors.

If you happen to have any ideas, I'm happy to listen to them

I haven't put a lot of thought into the details of what I'd like in it yet. In general, I'd like it to do the following: - Be more clear when the user has done something incorrectly, and when something else is going wrong. - If the user has some something incorrect, it should do what it can to direct them to fixing it. - Prettier display, i.e. colors. If you happen to have any ideas, I'm happy to listen to them
Author
Member
Copy link

@dataCobra any updates?

@dataCobra any updates?
Contributor
Copy link

No, I've been reading the eyre docs but because of not enough free time didn't updated anything.

No, I've been reading the eyre docs but because of not enough free time didn't updated anything.
Author
Member
Copy link

Alright! no worries, just thought I'd check in.

Alright! no worries, just thought I'd check in.
Author
Member
Copy link

@dataCobra any progress?

@dataCobra any progress?
Contributor
Copy link

Because of private duties I was unable to progress any further.

At the moment I'm also not able to tell when I might get back on track.

Sorry for the inconvenience.

Because of private duties I was unable to progress any further. At the moment I'm also not able to tell when I might get back on track. Sorry for the inconvenience.
Author
Member
Copy link

That's fine, I totally understand. I'll probably get around to this myself sometime, then. Take care!

That's fine, I totally understand. I'll probably get around to this myself sometime, then. Take care!

I was going to open a new issue but it seems like this would explain the:

Error: no repo info specified
Location:
 src/repo.rs:202:29

error for nearly every command from fj auth to fj repo create

At first I thought git init was required or I needed to specify codeberg.org in some way. But it seems it's the error reporting.

I'm on NixOS btw.
DISTRIB_DESCRIPTION="NixOS 26.05 (Yarara)"

I was going to open a new issue but it seems like this would explain the: ```sh Error: no repo info specified Location: src/repo.rs:202:29 ``` error for nearly every command from `fj auth` to `fj repo create` At first I thought `git init` was required or I needed to specify `codeberg.org` in some way. But it seems it's the error reporting. I'm on NixOS btw. `DISTRIB_DESCRIPTION="NixOS 26.05 (Yarara)"`
Author
Member
Copy link

@fuguesoft wrote in #112 (comment):

At first I thought git init was required or I needed to specify codeberg.org in some way.

Yes, you do need to do at least one of those. The errors aren't happening incorrectly, they're just unhelpful.

@fuguesoft wrote in https://codeberg.org/forgejo-contrib/forgejo-cli/issues/112#issuecomment-13370808: > At first I thought `git init` was required or I needed to specify `codeberg.org` in some way. Yes, you do need to do at least one of those. The errors aren't happening incorrectly, they're just unhelpful.

This is what I'm experiencing
https://asciinema.org/a/pIAEiwrIx3npWs7W

v0.4.1

I see that the fj auth login block is fixed in 5.0
And I am able to login by generating a token and doing fj auth add-key

That one particular error of "no repo information specified" seems maybe more like a bug?

I say this because the other errors seemed varied and somewhat useful

This is what I'm experiencing https://asciinema.org/a/pIAEiwrIx3npWs7W v0.4.1 I see that the `fj auth login` block is fixed in 5.0 And I am able to login by generating a token and doing `fj auth add-key` That one particular error of "no repo information specified" seems maybe more like a bug? I say this because the other errors seemed varied and somewhat useful
Collaborator
Copy link

The "no repo info specified" error in particular should've been improved since !278. It's a bit more clear why it happens now.

The "no repo info specified" error in particular should've been improved since !278. It's a bit more clear why it happens now.

Hi, I'd like to take this one. I've checked how other CLI tools handle errors and may have just enough time over the next week to implement this

Hi, I'd like to take this one. I've checked how other CLI tools handle errors and may have just enough time over the next week to implement this
Author
Member
Copy link

Feel free! Glad to have contributions on this

Feel free! Glad to have contributions on this
Author
Member
Copy link

@SLASHLogin I would like to let you know this is something that's likely to be affected by !279, which is very close to merging, so may be worth waiting for that.

@SLASHLogin I would like to let you know this is something that's likely to be affected by !279, which is very close to merging, so may be worth waiting for that.
Author
Member
Copy link

It's merged, you're good to go

It's merged, you're good to go
Sign in to join this conversation.
No Branch/Tag specified
main
renovate/lock-file-maintenance
docs/contributing
no-port-in-refspec
login/v16.next.forgejo.org
crates-io-publish
0.5.x
compile-time-fluent
0.4.x
localization-alias-demo
api_url_field
v0.5.0
v0.4.1
v0.4.0
v0.3.0
v0.2.0
v0.1.1
v0.1.0
v0.0.4
v0.0.3
v0.0.2
v0.0.1
Labels
Clear labels
Kind/Breaking
Breaking change that won't be backward compatible
Kind/Bug
Something is not working
Kind/Design
Discussion about UI/UX design
Kind/Documentation
Documentation changes
Kind/Enhancement
Improve existing functionality
Kind/Feature
New functionality
Kind/Security
This is security issue
Kind/Testing
Issue or pull request related to testing
Kind/Upstream
This is an issue with upstream software (Forgejo) that is probably not our fault
Priority
Critical
The priority is critical
Priority
High
The priority is high
Priority
Low
The priority is low
Priority
Medium
The priority is medium
Reviewed
Confirmed
Issue has been confirmed
Reviewed
Duplicate
This issue or pull request already exists
Reviewed
Invalid
Invalid issue
Reviewed
Won't Fix
This issue won't be fixed
Status
Abandoned
Somebody has started to work on this but abandoned work
Status
Blocked
Something is blocking this issue or pull request
Status
Need More Info
Feedback is required to reproduce issue or to continue work
Suspicious
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
5 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
forgejo-contrib/forgejo-cli#112
Reference in a new issue
forgejo-contrib/forgejo-cli
No description provided.
Delete branch "%!s()"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?