Skip to content

Commit c44418c

Browse files
committed
Improve exception messages, closes #35
1 parent 9db2184 commit c44418c

6 files changed

+8
-4
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
### Changed
77

88
- Use [Puli](http://puli.io) for discovery
9+
- Improved exception messages
910

1011

1112
## 0.5.0 - 2015-12-25

composer.json

+3
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@
2626
"phpspec/phpspec": "^2.4",
2727
"henrikbjorn/phpspec-code-coverage" : "^1.0"
2828
},
29+
"suggest": {
30+
"php-http/message": "Allow to use Guzzle or Diactoros factories"
31+
},
2932
"autoload": {
3033
"psr-4": {
3134
"Http\\Discovery\\": "src/"

src/ClassDiscovery.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ public static function findOneByType($type)
111111
return $binding->getClassName();
112112
}
113113

114-
throw new NotFoundException(sprintf('Binding of type "%s" not found', $type));
114+
throw new NotFoundException(sprintf('Resource of type "%s" not found', $type));
115115
}
116116

117117
/**

src/MessageFactoryDiscovery.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public static function find()
2424
return new $messageFactory();
2525
} catch (NotFoundException $e) {
2626
throw new NotFoundException(
27-
'No factories found. Install php-http/message to use Guzzle or Diactoros factories.',
27+
'No factories found. To use Guzzle or Diactoros factories install php-http/message and the chosen message implementation.',
2828
0,
2929
$e
3030
);

src/StreamFactoryDiscovery.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public static function find()
2424
return new $streamFactory();
2525
} catch (NotFoundException $e) {
2626
throw new NotFoundException(
27-
'No factories found. Install php-http/message to use Guzzle or Diactoros factories.',
27+
'No factories found. To use Guzzle or Diactoros factories install php-http/message and the chosen message implementation.',
2828
0,
2929
$e
3030
);

src/UriFactoryDiscovery.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public static function find()
2424
return new $uriFactory();
2525
} catch (NotFoundException $e) {
2626
throw new NotFoundException(
27-
'No factories found. Install php-http/message to use Guzzle or Diactoros factories.',
27+
'No factories found. To use Guzzle or Diactoros factories install php-http/message and the chosen message implementation.',
2828
0,
2929
$e
3030
);

0 commit comments

Comments
 (0)