Giter Club home page Giter Club logo

constata-client's People

Contributors

bronxi47 avatar maxidev avatar nubis avatar smtx avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

constata-client's Issues

Mostrar errores amigables en constata cli.

1. Al pasarle un directorio y no un documento a stamp, devuelve lo siguiente:

thread 'main' panicked at 'Sign and timestamp to succeed: Io(Os { code: 21, kind: Other, message: "Is a directory" })', src/bin.rs:99:8
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

Si bien glosa "Is a directory", debería limpiarse la salida para que solo "Is a directory" y agregar que debe utilizarse stamp sobre files.

{dir_name} Is a directory. Stamping could only be applied on files. If you want to stamp an entire directory, consider compress it into a zip file

  • Modificado (#6)

2. Algo similar sucede al no encontrar el archivo:

thread 'main' panicked at 'Sign and timestamp to succeed: Io(Os { code: 2, kind: NotFound, message: "No such file or directory" })', src/bin.rs:99:8
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

File not found using path ...

  • Modificado (#6)

Al darle un argumento inesperado a stamp la salida es bastante clara, algo similar debería suceder con los dos errores anteriores. El uso de diferentes colores, rojo para "error" y degrade para "--help", como ya está implementado, hacen mucho más legible la salida :)

3. Modificar el error de salida al introducir un daily pass incorrecto:

thread 'main' panicked at 'called Result::unwrap() on an Err value: DailyKeyEncriptionError', src/bin.rs:94:55
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

Daily password is incorrect.

#8

  • Modificado

4. Error de re-stamp (si ya se aplicó el comando stamp a un documento)

thread 'main' panicked at 'Sign and timestamp to succeed: Network(Status(422, Response[status: 422, status_text: Unprocessable Entity, url: https://api-staging.constata.eu/documents/]))', src/bin.rs:99:8
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace
Desde el engine (public api) necesitamos mas información del error para identificarlo

Podría tener como salida "Este documento ha sido sellado anteriormente, su document_id es xxxxxxxxxxxxxxxxxxxxx"

This document was already stamped. document_id: xxxxxxx

  • Modificado

5. Si el archivo está vacío lanza el mismo error, podría modificarse por "El documento que intentas sellar is empty":

thread 'main' panicked at 'Sign and timestamp to succeed: Network(Status(422, Response[status: 422, status_text: Unprocessable Entity, url: https://api-staging.constata.eu/documents/]))', src/bin.rs:99:8
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace
Desde el engine (public api) necesitamos mas información del error para identificarlo

This document is empty. We can't stamp empty documents

  • Modificado

6. Al intentar hacer fetch-proof de un documento que todavía no ha sido publicado, el error es el siguiente:

thread 'main' panicked at 'called Result::unwrap() on an Err value: Network(Status(404, Response[status: 404, status_text: Not Found, url: https://api-staging.constata.eu/documents/12-79f9569b7616326f45059f28a3a3ba2a9f4834a9f36717f95a093b66352/html_proof]))', src/bin.rs:110:8
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

Revisar public_api para ver si se puede diferenciar un documento pending a uno inexistente. (si es pending mostrar ETA)

Podría modificarse por "El documento aún no ha sido publicado, su estado es "draft o pending". Intenta más tarde."

Document not published yet. Try later. Estimated published time: ...

en el caso de que no exista

Document Id is wrong

  • Modificado

Error al pipear el output del constata-cli a otro comando.

Al utilizar pipe para la salida de cualquier comando genera el siguiente output:

thread 'main' panicked at 'failed printing to stdout: Broken pipe (os error 32)', library/std/src/io/stdio.rs:935:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Cabe aclarar que los comandos se ejecutan sin problemas y el pipe redirige perfectamente la salida a comandos como grep o awk. Pero persiste dicha salida, lo que puede generar confusión en el usuario.

Aquí un caso similar:
rust-lang/rust#46016

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.