Skip to content

Commit

Permalink
Spanner system tests (#589)
Browse files Browse the repository at this point in the history
* WIP

* Run system tests in Travis-CI Cron

* Improve system test run, fix storage tests

* Rebase and fix storage

* Move credentials configurator to executable script

* Add system coverage

* Add large read test for chunking

* WIP

* WIP

* Address code review
  • Loading branch information
jdpedrie authored Jul 31, 2017
1 parent 1d45b2e commit d06766e
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 0 deletions.
27 changes: 27 additions & 0 deletions Exception/DeadlineExceededException.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php
/**
* Copyright 2017 Google Inc. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

namespace Google\Cloud\Core\Exception;

/**
* Exception thrown when a request takes too long to complete.
* In REST context, this exception indicates a status code 504.
*/
class DeadlineExceededException extends ServiceException
{

}
4 changes: 4 additions & 0 deletions GrpcRequestWrapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,10 @@ private function convertToGoogleException(ApiException $ex)
$exception = Exception\AbortedException::class;
break;

case Grpc\STATUS_DEADLINE_EXCEEDED:
$exception = Exception\DeadlineExceededException::class;
break;

default:
$exception = Exception\ServiceException::class;
break;
Expand Down
4 changes: 4 additions & 0 deletions RequestWrapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,10 @@ private function convertToGoogleException(\Exception $ex)
$exception = Exception\ServerException::class;
break;

case 504:
$exception = Exception\DeadlineExceededException::class;
break;

default:
$exception = Exception\ServiceException::class;
break;
Expand Down

0 comments on commit d06766e

Please sign in to comment.