diff --git a/core/lib/Drupal/Core/EventSubscriber/SpecialAttributesRouteSubscriber.php b/core/lib/Drupal/Core/EventSubscriber/SpecialAttributesRouteSubscriber.php
index 22e82d2..5a08f6f 100644
--- a/core/lib/Drupal/Core/EventSubscriber/SpecialAttributesRouteSubscriber.php
+++ b/core/lib/Drupal/Core/EventSubscriber/SpecialAttributesRouteSubscriber.php
@@ -24,8 +24,8 @@ class SpecialAttributesRouteSubscriber implements EventSubscriberInterface {
    * @param \Drupal\Core\Routing\RouteBuildEvent $event
    *   The event containing the build routes.
    *
-   * @throws \InvalidArgumentException
-   *   Thrown when a reserved variable was used as route variable.
+   * @return bool
+   *   Returns TRUE if all routes have been valid, otherwise FALSE.
    */
   public function onRouteBuilding(RouteBuildEvent $event) {
     $special_variables = array(
@@ -44,8 +44,7 @@ public function onRouteBuilding(RouteBuildEvent $event) {
     foreach ($event->getRouteCollection()->all() as $route) {
       if ($not_allowed_variables = array_intersect($route->compile()->getVariables(), $special_variables)) {
         $placeholders = array('@variables' => implode(', ', $not_allowed_variables));
-        drupal_set_message(String::format('The following variables are reserved names by drupal: @variables', $placeholders));
-        watchdog('error', 'The following variables are reserved names by drupal: @variables', $placeholders);
+        trigger_error(String::format('The following variables are reserved names by drupal: @variables', $placeholders), E_USER_WARNING);
         return FALSE;
       }
     }
diff --git a/core/tests/Drupal/Tests/Core/EventSubscriber/SpecialAttributesRouteSubscriberTest.php b/core/tests/Drupal/Tests/Core/EventSubscriber/SpecialAttributesRouteSubscriberTest.php
index 7555768..d780702 100644
--- a/core/tests/Drupal/Tests/Core/EventSubscriber/SpecialAttributesRouteSubscriberTest.php
+++ b/core/tests/Drupal/Tests/Core/EventSubscriber/SpecialAttributesRouteSubscriberTest.php
@@ -105,6 +105,7 @@ public function testOnRouteBuildingValidVariables(Route $route) {
    *   The route to check.
    *
    * @dataProvider providerTestOnRouteBuildingInvalidVariables
+   * @expectedException \PHPUnit_Framework_Error_Warning
    */
   public function testOnRouteBuildingInvalidVariables(Route $route) {
     $route_collection = new RouteCollection();
