forked from chuyeow/myanimelist-api
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmy_anime_list.rb
46 lines (37 loc) · 1.07 KB
/
my_anime_list.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
require 'curb'
require 'nokogiri'
require 'my_anime_list/rack'
require 'my_anime_list/anime'
require 'my_anime_list/anime_list'
module MyAnimeList
# Raised when there're any network errors.
class NetworkError < StandardError
attr_accessor :original_exception
def initialize(message, original_exception = nil)
@message = message
@original_exception = original_exception
super(message)
end
def to_s; @message; end
end
# Raised when there's an error updating an anime.
class UpdateError < StandardError
attr_accessor :original_exception
def initialize(message, original_exception = nil)
@message = message
@original_exception = original_exception
super(message)
end
def to_s; @message; end
end
# Raised when an error we didn't expect occurs.
class UnknownError < StandardError
attr_accessor :original_exception
def initialize(message, original_exception = nil)
@message = message
@original_exception = original_exception
super(message)
end
def to_s; @message; end
end
end