Steve McIntyre | 94ef65e | 2015-09-25 01:08:14 +0100 | [diff] [blame] | 1 | # Copyright 2014-2015 Linaro Limited |
| 2 | # Authors: Dave Pigott <dave.pigot@linaro.org>, |
| 3 | # Steve McIntyre <steve.mcintyre@linaro.org> |
Dave Pigott | 9b73f3a | 2014-09-18 22:55:42 +0100 | [diff] [blame] | 4 | # |
| 5 | # This program is free software; you can redistribute it and/or modify |
| 6 | # it under the terms of the GNU General Public License as published by |
| 7 | # the Free Software Foundation; either version 2 of the License, or |
| 8 | # (at your option) any later version. |
| 9 | # |
| 10 | # This program is distributed in the hope that it will be useful, |
| 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | # GNU General Public License for more details. |
| 14 | # |
| 15 | # You should have received a copy of the GNU General Public License |
| 16 | # along with this program; if not, write to the Free Software |
| 17 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
| 18 | # MA 02110-1301, USA. |
| 19 | |
| 20 | class VlandError(Exception): |
| 21 | """ |
| 22 | Base exception and error class for the vlan daemon |
| 23 | """ |
| 24 | |
| 25 | |
| 26 | class CriticalError(VlandError): |
| 27 | """ |
| 28 | The critical error |
| 29 | """ |
Steve McIntyre | 4afdb9b | 2014-12-02 12:34:49 +0000 | [diff] [blame] | 30 | |
Steve McIntyre | b01959f | 2016-03-22 17:02:39 +0000 | [diff] [blame^] | 31 | class NotFoundError(VlandError): |
| 32 | """ |
| 33 | Couldn't find object |
| 34 | """ |
| 35 | |
Steve McIntyre | 4afdb9b | 2014-12-02 12:34:49 +0000 | [diff] [blame] | 36 | class InputError(VlandError): |
| 37 | """ |
| 38 | Invalid input |
| 39 | """ |
| 40 | |
Steve McIntyre | af0a71a | 2014-12-10 14:19:00 +0000 | [diff] [blame] | 41 | class ConfigError(VlandError): |
| 42 | """ |
| 43 | Invalid configuration |
| 44 | """ |
| 45 | |
Steve McIntyre | 1427c14 | 2014-12-12 18:24:40 +0000 | [diff] [blame] | 46 | class SocketError(VlandError): |
| 47 | """ |
| 48 | Socket connection failure |
| 49 | """ |
| 50 | |
Steve McIntyre | 26eaff3 | 2015-02-12 03:14:56 +0000 | [diff] [blame] | 51 | class PExpectError(VlandError): |
| 52 | """ |
| 53 | CLI communication failure |
| 54 | """ |
| 55 | |
Steve McIntyre | b01959f | 2016-03-22 17:02:39 +0000 | [diff] [blame^] | 56 | class Error: |
| 57 | OK = 0 |
| 58 | FAILED = 1 |
| 59 | NOTFOUND = 2 |