guzzle / guzzle-services

Provides an implementation of the Guzzle Command library that uses Guzzle service descriptions to describe web services, serialize requests, and parse responses into easy to use model structures.
MIT License
253 stars 78 forks source link

Runtime Exception Error is always empty #99

Closed james2doyle closed 8 years ago

james2doyle commented 8 years ago

It looks like this line will always give you an incomplete message. See the following:

// if the location is not set
if (!isset($this->requestLocations[$location])) {
    // then, give me an error with that location?
    throw new \RuntimeException("No location registered for $location");
}

In the source, $location will always be empty when throwing this Exception. Further up the code, there is a variable called $name which is the key for that current working item. I propose the following:

// if the location is not set
if (!isset($this->requestLocations[$location])) {
    // then, give me an error the key name of the offending item
    throw new \RuntimeException("No location registered for $name");
}

In the code above, we return the offending array's key. I believe this was the original intention.