Fix errors caused by Pawoo exceptions
This commit is contained in:
@@ -109,11 +109,26 @@ class PawooApiClient
|
||||
|
||||
def get(url)
|
||||
if id = Status.is_match?(url)
|
||||
return Status.new(JSON.parse(access_token.get("/api/v1/statuses/#{id}").body))
|
||||
begin
|
||||
data = JSON.parse(access_token.get("/api/v1/statuses/#{id}").body)
|
||||
rescue
|
||||
data = {
|
||||
"account" => {},
|
||||
"media_attachments" => [],
|
||||
"tags" => [],
|
||||
"content" => "",
|
||||
}
|
||||
end
|
||||
return Status.new(data)
|
||||
end
|
||||
|
||||
if id = Account.is_match?(url)
|
||||
return Account.new(JSON.parse(access_token.get("/api/v1/accounts/#{id}").body))
|
||||
begin
|
||||
data = JSON.parse(access_token.get("/api/v1/accounts/#{id}").body)
|
||||
rescue
|
||||
data = {}
|
||||
end
|
||||
return Account.new(data)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user