hanami-router 2.0.0.alpha3 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,67 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Hanami
4
- class Router
5
- # Base error
6
- #
7
- # @since 0.5.0
8
- class Error < StandardError
9
- end
10
-
11
- # Missing endpoint error. It's raised when the route definition is missing `to:` endpoint and a block.
12
- #
13
- # @since 2.0.0
14
- class MissingEndpointError < Error
15
- def initialize(path)
16
- super("missing endpoint for #{path.inspect}")
17
- end
18
- end
19
-
20
- # Invalid route exception. It's raised when the router cannot recognize a route
21
- #
22
- # @since 2.0.0
23
- class InvalidRouteException < Error
24
- def initialize(name)
25
- super("No route could be generated for #{name.inspect} - please check given arguments")
26
- end
27
- end
28
-
29
- # Invalid route expansion exception. It's raised when the router recognizes
30
- # a route but given variables cannot be expanded into a path/url
31
- #
32
- # @since 2.0.0
33
- #
34
- # @see Hanami::Router#path
35
- # @see Hanami::Router#url
36
- class InvalidRouteExpansionException < Error
37
- def initialize(name, message)
38
- super("No route could be generated for `#{name.inspect}': #{message}")
39
- end
40
- end
41
-
42
- # Handle unknown HTTP status codes
43
- #
44
- # @since 2.0.0
45
- class UnknownHTTPStatusCodeError < Error
46
- def initialize(code)
47
- super("Unknown HTTP status code: #{code.inspect}")
48
- end
49
- end
50
-
51
- # This error is raised when <tt>#call</tt> is invoked on a non-routable
52
- # recognized route.
53
- #
54
- # @since 0.5.0
55
- #
56
- # @see Hanami::Router#recognize
57
- # @see Hanami::Router::RecognizedRoute
58
- # @see Hanami::Router::RecognizedRoute#call
59
- # @see Hanami::Router::RecognizedRoute#routable?
60
- class NotRoutableEndpointError < Error
61
- # @since 0.5.0
62
- def initialize(env)
63
- super %(Cannot find routable endpoint for: #{env['REQUEST_METHOD']} #{env['PATH_INFO']})
64
- end
65
- end
66
- end
67
- end