PageRenderTime 90ms CodeModel.GetById 84ms app.highlight 3ms RepoModel.GetById 2ms app.codeStats 0ms

/Classes/UseXBMCScrapers/Exceptions.vb

#
Visual Basic | 103 lines | 65 code | 26 blank | 12 comment | 1 complexity | df2b0e581021f94a72f00c0b68c77c41 MD5 | raw file
  1' XScraperLib - .NET library for accessing XBMC-style metadata scrapers.
  2' Copyright (C) 2010  John Klimek
  3
  4' This program is free software: you can redistribute it and/or modify
  5' it under the terms of the GNU General Public License as published by
  6' the Free Software Foundation, either version 3 of the License, or
  7' any later version.
  8
  9' This program is distributed in the hope that it will be useful,
 10' but WITHOUT ANY WARRANTY; without even the implied warranty of
 11' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 12' GNU General Public License for more details.
 13
 14' You should have received a copy of the GNU General Public License
 15' along with this program.  If not, see <http://www.gnu.org/licenses/>.
 16
 17Public Class RequiredAddonNotFound
 18   Inherits System.Exception
 19
 20   Private mScraperID As String
 21
 22   Public ReadOnly Property ScraperID() As String
 23      Get
 24         Return mScraperID
 25      End Get
 26   End Property
 27
 28   Sub New(ByVal scraperID As String)
 29      MyBase.New("Required addon not found: " + scraperID)
 30
 31      mScraperID = scraperID
 32   End Sub
 33End Class
 34
 35Public Class FunctionNotFound
 36   Inherits System.Exception
 37
 38   Private mFunctionName As String
 39
 40   Public ReadOnly Property FunctionName() As String
 41      Get
 42         Return mFunctionName
 43      End Get
 44   End Property
 45
 46   Sub New(ByVal functionName As String)
 47      MyBase.New("Function not found: " + functionName)
 48
 49      mFunctionName = functionName
 50   End Sub
 51End Class
 52
 53Public Class FullXmlTreeNotBuilt
 54   Inherits System.Exception
 55
 56   Sub New()
 57      MyBase.New("Full XML tree is not built.  You must call BuildXmlWithRequiredAddons().")
 58   End Sub
 59End Class
 60
 61Public Class OuterChainElementIncorrect
 62   Inherits System.Exception
 63
 64   Private mOuterChainElement As String
 65
 66   Public ReadOnly Property OuterChainElement() As String
 67      Get
 68         Return mOuterChainElement
 69      End Get
 70   End Property
 71
 72   Sub New(ByVal outerChainElement As String)
 73      MyBase.New("Chain functions are expected to return a <details> tag but the outer tag was: " + outerChainElement)
 74
 75      mOuterChainElement = outerChainElement
 76   End Sub
 77End Class
 78
 79Public Class InvalidScraperSettingValue
 80   Inherits System.Exception
 81
 82   Private mScraperSetting As ScraperSettingEnum
 83   Private mScraperSettingValue As String
 84
 85   Public ReadOnly Property ScraperSettingValue() As String
 86      Get
 87         Return mScraperSettingValue
 88      End Get
 89   End Property
 90
 91   Public ReadOnly Property ScraperSetting() As ScraperSettingEnum
 92      Get
 93         Return mScraperSetting
 94      End Get
 95   End Property
 96
 97   Sub New(ByVal scraperSetting As ScraperSettingEnum, ByVal scraperSettingValue As String)
 98      MyBase.New("Value (" + scraperSettingValue + ") is not valid for scraper setting: " + scraperSetting.ID)
 99
100      mScraperSetting = scraperSetting
101      mScraperSettingValue = scraperSettingValue
102   End Sub
103End Class