Giter Site home page Giter Site logo

Comments (2)

chrstphrknwtn avatar chrstphrknwtn commented on August 16, 2024

In terms of usability, this is sorely needed. At the moment, errors are just dumped into the .log where one must search through to find the actual reason for netlifyctl returning an error.

A perfect example is trying a command that requires auth, without having first logged in. One would expect that running netlifyctl assets when not logged in would just prompt you to login, as you're attempting an operation that requires auth. As it is, you just get a big fat error log file that pollutes your repo.

from netlifyctl.

robphoenix avatar robphoenix commented on August 16, 2024

Another example, running netlifyctl init for the first time:

Received error:

netlifyctl-windows-amd64-0.3.2 ❯ ./netlifyctl.exe init
There was an error running this command.
Debug log dumped to netlifyctl-debug.log
This log includes full recordings of HTTP requests with credentials, be careful if you share it

Logs:

netlifyctl-windows-amd64-0.3.2 ❯ cat netlifyctl-debug.log
time="06 Apr 18 16:00 +0100" level=debug msg=PreRun arguments=[] command=init
time="06 Apr 18 16:00 +0100" level=debug msg="configure debug middleware"
time="06 Apr 18 16:00 +0100" level=debug msg="configure logging middleware"
time="06 Apr 18 16:00 +0100" level=debug msg="setup logger middleware: panic"
time="06 Apr 18 16:00 +0100" level=debug msg="configure auth middleware"
time="06 Apr 18 16:00 +0100" level=debug msg="setup credentials" credentials=0x877cc0
time="06 Apr 18 16:00 +0100" level=debug msg="configure client middleware"
time="06 Apr 18 16:00 +0100" level=debug msg="setup API endpoint" endpoint="https://api.netlify.com"
time="06 Apr 18 16:00 +0100" level=error msg="command failed" error="repository not exists"

Would it be possible to include the error in the returned string from here? The debug log could perhaps only be written if a debug flag is passed and instead the error written to stdout/stderr. In this way I would have received the following error instead of the above:

~ ❯ netlifyctl init
repository does not exist

It's still not hugely helpful, the message comes from the src-d/go-git.v4 package but the messages could be received and improved in some way perhaps depending on the error, ie. adding please run init inside a git repository?

from netlifyctl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.