Permalink
Browse files

Better error reporting in exception.

  • Loading branch information...
1 parent 542e74b commit 63ba5f5109c797e28511dbbe91200bfb72fc9095 @robacarp robacarp committed Mar 28, 2013
Showing with 1 addition and 1 deletion.
  1. +1 −1 Shipping/Endicia/Quoter.php
@@ -45,7 +45,7 @@ class Quoter extends Endicia {
*/
public function quote(){
if ( ! $this->from instanceof Address)
- throw new \LogicException("From address must be a SparkLib\Shipping\Address. Set Quote#from before fetching quotes");
+ throw new \LogicException("From address must be a SparkLib\Shipping\Address. Got " . get_class($this->from) . " instead. Set Quote#from before fetching quotes.");
if ( ! $this->to instanceof Address)
throw new \LogicException("To address must be a SparkLib\Shipping\Address. Set Quote#to before fetching quotes");
if ($this->dimensions === null || ! is_array($this->dimensions) || count($this->dimensions) != 3)

0 comments on commit 63ba5f5

Please sign in to comment.