Giter VIP home page Giter VIP logo

budibase-core's People

Contributors

danbudi avatar marblekirby avatar mjashanks avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

budibase-core's Issues

Project has no style guidelines

We must adopt a set of style guidelines.

  • We begin with an existing, widely used guidelines
  • The choice should preferably be as close to the current style as possible
  • We should add linting into webpack config
  • Linting should be applicable by common text editors (e.g. VS Code)

Attach HTTP Status code to exceptions where relevant

The webserver consumes budibase-core. Currently, when an exception occurs in budibase-core, it will always manifest as a 500 Internal Server Error.

There are a few cases where we can give a better status

  • in apiWrapper > HandleUnauthorized - we could be returning a 403
  • anytime a record or index is not found, we could return a 404

I suggest that we implement this as follows:

//  common/errors.js
export const ForbiddenError = (message) => {
    const err = new Error(message);
    err.HttpStatus = 403;
    return err
}

// somwehere where exception is being thrown
throw ForbiddenError("Not authorized to create Customer record");

404s may be difficult, as these may often be raised by the datastore implementation (which is plugged in and not part of budibase-core. e.g node "fs" may throw "File not found /customers/1-abcd/record.json"

... or this could just be a matter of applying this logic inside that datastores also... proabbly makes sense.

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.