GithubHelp home page GithubHelp logo

aptible-resource's People

Contributors

aaw avatar almathew avatar blakepettersson avatar krallin avatar mattwiese-aptible avatar skylar-anderson avatar usernotfound avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

aptible-resource's Issues

Do away with non-bang `#create_XXX` methods?

The current #create_XXX methods (e.g. app.create_operation) swallow errors, and return a Aptible::Resource::Base object, which can be very confusing, especially considering that attempting to reload those resources will throw an immensely cryptic Resource server root URL must be defined by subclass error.

Now, we do have equivalent bang methods (e.g. app.create_operation!), which do throw exception, but they're not used everywhere.

For example, in aptible-integration, we're using app.create_operation practically everywhere), and when it started throwing Resource server root URL must be defined by subclass (https://travis-ci.com/aptible/aptible-integration/jobs/41749266), it wasn't immediately obvious at all that the cause was in API (ultimately https://github.com/aptible/api.aptible.com/pull/373).

Is there value in having methods that swallow errors? Is there value in that being the most natural method call? I think the answer to both questions is no, and I think we should simply make both methods do the same thing (i.e. raise exceptions), and possibly raise a deprecation warning on the bang methods that they're now redundant.

Thoughts @blakepettersson @fancyremarker?

Retire all uses of hyperresource-aptible

So far it's:

$ grep -r hyperresource-aptible */Gemfile.lock | sed 's/:.*//' | sort | uniq
api.aptible.com/Gemfile.lock
aptible-cli/Gemfile.lock
megatron/Gemfile.lock
policy.aptible.com/Gemfile.lock
primetime/Gemfile.lock

Unable to access a resource object with errors

@database.errors
# => #<Aptible::Resource::Errors:0x007fe94d746330 @messages={:base=>"Validation failed: Handle can't be blank, Handle is invalid"}, @full_messages=["Validation failed: Handle can't be blank, Handle is invalid"], @status_code=422>
@database.class
# => Aptible::Resource::Base
@database
# >> (pry) output error: #<RuntimeError: Resource server namespace must be defined by subclass>

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.