1# Copyright 2018 The Chromium OS Authors. All rights reserved. 2# Use of this source code is governed by a BSD-style license that can be 3# found in the LICENSE file. 4 5"""Definition of CrOS suite exceptions in skylab.""" 6 7 8class DroneEnvironmentError(Exception): 9 """Raised on incorrect setup of the drone executing skylab_suite.""" 10 11 12class InValidPropertyError(Exception): 13 """Raised if a suite's property is not valid.""" 14 15 16class NoAvailableDUTsError(Exception): 17 """Raised if there's no available DUTs for provision suite.""" 18 def __init__(self, board, pool, available_num, required_num): 19 self.board = board 20 self.pool = pool 21 self.available_num = available_num 22 self.required_num = required_num 23 super(NoAvailableDUTsError, self).__init__( 24 board, pool, available_num, required_num) 25 26 def __str__(self): 27 return ('The available number of DUTs for board %s and pool %s is %d ,' 28 'which is less than %d, the required number.' % ( 29 self.board, self.pool, self.available_num, 30 self.required_num)) 31