diff options
author | Keuin <[email protected]> | 2022-09-14 03:02:51 +0800 |
---|---|---|
committer | Keuin <[email protected]> | 2022-09-14 03:04:52 +0800 |
commit | 7902849dc021610b0ec16d1130b9515efd1f64b1 (patch) | |
tree | 058c1aca3a4947f75b0ba73f6f205498a1e186e5 /bilibili | |
parent | ed3db79b86e9ea2c796cccedf1454a45823293a4 (diff) |
Refactor: proper error handling.v0.3.3
Diffstat (limited to 'bilibili')
-rw-r--r-- | bilibili/errors.go | 7 | ||||
-rw-r--r-- | bilibili/streaming.go | 2 |
2 files changed, 1 insertions, 8 deletions
diff --git a/bilibili/errors.go b/bilibili/errors.go deleted file mode 100644 index 3f8ac9b..0000000 --- a/bilibili/errors.go +++ /dev/null @@ -1,7 +0,0 @@ -package bilibili - -import "fmt" - -var ( - ErrRoomIsClosed = fmt.Errorf("living room is closed") -) diff --git a/bilibili/streaming.go b/bilibili/streaming.go index c89126d..ea9207c 100644 --- a/bilibili/streaming.go +++ b/bilibili/streaming.go @@ -42,7 +42,7 @@ func (b Bilibili) CopyLiveStream( // 404 when not streaming if resp.StatusCode == http.StatusNotFound { - return ErrRoomIsClosed + return fmt.Errorf("live is not started or the room does not exist") } err = validateHttpStatus(resp) |