Giter Club home page Giter Club logo

appharbor.net's Issues

AppHarborClient.GetHostnames throws ArgumentNullException

I have a simple test application enumerates sites and their hostnames:

static void apitest()
{
    var authInfo = new AuthInfo(ACCESS_TOKEN);
    var ah = new AppHarborClient(authInfo);
    foreach (var application in ah.GetApplications())
    {
        Console.WriteLine("----");
        Console.WriteLine(application.Name);
        Console.WriteLine(application.Slug);
        Console.WriteLine(application.Url);

        var hostnames = ah.GetHostnames(application.Slug);
        foreach (var hostname in hostnames)
        {
            Console.WriteLine(" * " + hostname.Id);
            Console.WriteLine(" * " + hostname.Value);
            Console.WriteLine(" * " + hostname.Url);
            Console.WriteLine(" * " + hostname.Canonical);
        }
    }
}

It blow ups at GetHostnames:

Test 'M:AppHarborTest.Program.apitest' failed: Value cannot be null.
Parameter name: url
    System.ArgumentNullException: Value cannot be null.
    Parameter name: url
    AppHarborClient.cs(184,0): at AppHarbor.AppHarborClient.CheckArgumentNull(String argumentName, Object value)
    AppHarborClient.cs(51,0): at AppHarbor.AppHarborClient.ExtractId(Uri url)
    AppHarborClient.cs(103,0): at AppHarbor.AppHarborClient.ExecuteGetListKeyed[T](RestRequest request)
    AppHarborClient.Hostname.cs(29,0): at AppHarbor.AppHarborClient.GetHostnames(String applicationSlug)
    Program.cs(50,0): at AppHarborTest.Program.apitest()

The failing code is in: AppHarborClient.ExecuteGetListKeyed:

    foreach (var item in data)
    {
        item.Id = ExtractId(item.Url);
    }

ExtractId() is throwing on a null URL.

Looking at the traffic over fiddler:

GET https://appharbor.com/applications/my-slug/hostnames

Returns:

[
  {
    "value": "my-site.example.com",
    "canonical": false,
    "url": "https://appharbor.com/applications/my-slug/hostnames/3456"
  },
  {
    "value": "my-slug.apphb.com",
    "canonical": false,
    "url": null
  }
]

Looking at the others it seems for the default apphb URLs that url us always null.

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.