From f97cdb291c8348c786655d817f1f19d1d6300606 Mon Sep 17 00:00:00 2001 From: Tony Date: Thu, 7 Apr 2022 16:34:33 +0200 Subject: [PATCH] fix: lack of config error url (#9490) --- lib/routes/disqus/posts.js | 2 +- lib/routes/fanfou/favorites.js | 2 +- lib/routes/fanfou/home_timeline.js | 2 +- lib/routes/fanfou/public_timeline.js | 2 +- lib/routes/fanfou/user_timeline.js | 2 +- lib/routes/instagram/utils.js | 2 +- lib/routes/lastfm/loved.js | 2 +- lib/routes/lastfm/recent.js | 2 +- lib/routes/lastfm/top.js | 2 +- lib/routes/nhentai/util.js | 2 +- lib/routes/pixiv/bookmarks.js | 2 +- lib/routes/pixiv/illustfollow.js | 2 +- lib/routes/pixiv/ranking.js | 2 +- lib/routes/pixiv/search.js | 2 +- lib/routes/pixiv/user.js | 2 +- lib/routes/twitter/likes.js | 2 +- lib/routes/twitter/list.js | 2 +- lib/routes/twitter/trends.js | 2 +- lib/routes/youtube/channel.js | 2 +- lib/routes/youtube/playlist.js | 2 +- lib/routes/youtube/user.js | 2 +- lib/v2/telegram/stickerpack.js | 2 +- 22 files changed, 22 insertions(+), 22 deletions(-) diff --git a/lib/routes/disqus/posts.js b/lib/routes/disqus/posts.js index 25c964d01bc5d6..af0a1e2e9deeef 100644 --- a/lib/routes/disqus/posts.js +++ b/lib/routes/disqus/posts.js @@ -3,7 +3,7 @@ const config = require('@/config').value; module.exports = async (ctx) => { if (!config.disqus || !config.disqus.api_key) { - throw 'Disqus RSS is disabled due to the lack of relevant config'; + throw 'Disqus RSS is disabled due to the lack of relevant config'; } const forum = ctx.params.forum; diff --git a/lib/routes/fanfou/favorites.js b/lib/routes/fanfou/favorites.js index 97e07fe55de00d..589e8993ad8ea2 100644 --- a/lib/routes/fanfou/favorites.js +++ b/lib/routes/fanfou/favorites.js @@ -3,7 +3,7 @@ const utils = require('./utils'); module.exports = async (ctx) => { if (!config.fanfou || !config.fanfou.consumer_key || !config.fanfou.consumer_secret || !config.fanfou.username || !config.fanfou.password) { - throw 'Fanfou RSS is disabled due to the lack of relevant config'; + throw 'Fanfou RSS is disabled due to the lack of relevant config'; } const uid = ctx.params.uid; diff --git a/lib/routes/fanfou/home_timeline.js b/lib/routes/fanfou/home_timeline.js index b5364fd14f4e53..f5fc817ac15149 100644 --- a/lib/routes/fanfou/home_timeline.js +++ b/lib/routes/fanfou/home_timeline.js @@ -3,7 +3,7 @@ const utils = require('./utils'); module.exports = async (ctx) => { if (!config.fanfou || !config.fanfou.consumer_key || !config.fanfou.consumer_secret || !config.fanfou.username || !config.fanfou.password) { - throw 'Fanfou RSS is disabled due to the lack of relevant config'; + throw 'Fanfou RSS is disabled due to the lack of relevant config'; } const fanfou = await utils.getFanfou(); diff --git a/lib/routes/fanfou/public_timeline.js b/lib/routes/fanfou/public_timeline.js index aec3c5582b80c8..c28df8ef2e4c2f 100644 --- a/lib/routes/fanfou/public_timeline.js +++ b/lib/routes/fanfou/public_timeline.js @@ -3,7 +3,7 @@ const utils = require('./utils'); module.exports = async (ctx) => { if (!config.fanfou || !config.fanfou.consumer_key || !config.fanfou.consumer_secret || !config.fanfou.username || !config.fanfou.password) { - throw 'Fanfou RSS is disabled due to the lack of relevant config'; + throw 'Fanfou RSS is disabled due to the lack of relevant config'; } const keyword = ctx.params.keyword; diff --git a/lib/routes/fanfou/user_timeline.js b/lib/routes/fanfou/user_timeline.js index 62fc3d1d4b9a65..a4e276a080dd07 100644 --- a/lib/routes/fanfou/user_timeline.js +++ b/lib/routes/fanfou/user_timeline.js @@ -3,7 +3,7 @@ const utils = require('./utils'); module.exports = async (ctx) => { if (!config.fanfou || !config.fanfou.consumer_key || !config.fanfou.consumer_secret || !config.fanfou.username || !config.fanfou.password) { - throw 'Fanfou RSS is disabled due to the lack of relevant config'; + throw 'Fanfou RSS is disabled due to the lack of relevant config'; } const uid = ctx.params.uid; diff --git a/lib/routes/instagram/utils.js b/lib/routes/instagram/utils.js index 4f4c01e375e625..25adcc0e965311 100644 --- a/lib/routes/instagram/utils.js +++ b/lib/routes/instagram/utils.js @@ -21,7 +21,7 @@ async function login(ig) { logger.error('Instagram login fail: ' + error); } } else { - throw Error('Instagram username and password are required to be set in the environment.'); + throw Error('Instagram RSS is disabled due to the lack of relevant config'); } } diff --git a/lib/routes/lastfm/loved.js b/lib/routes/lastfm/loved.js index 5e6287b502ec67..218c5f9751f052 100644 --- a/lib/routes/lastfm/loved.js +++ b/lib/routes/lastfm/loved.js @@ -3,7 +3,7 @@ const config = require('@/config').value; module.exports = async (ctx) => { if (!config.lastfm || !config.lastfm.api_key) { - throw 'Last.fm RSS is disabled due to the lack of relevant config'; + throw 'Last.fm RSS is disabled due to the lack of relevant config'; } const user = ctx.params.user; diff --git a/lib/routes/lastfm/recent.js b/lib/routes/lastfm/recent.js index 00481248256529..b15d155dc1ffc9 100644 --- a/lib/routes/lastfm/recent.js +++ b/lib/routes/lastfm/recent.js @@ -3,7 +3,7 @@ const config = require('@/config').value; module.exports = async (ctx) => { if (!config.lastfm || !config.lastfm.api_key) { - throw 'Last.fm RSS is disabled due to the lack of relevant config'; + throw 'Last.fm RSS is disabled due to the lack of relevant config'; } const user = ctx.params.user; diff --git a/lib/routes/lastfm/top.js b/lib/routes/lastfm/top.js index 6faf1720e7ee1f..b3b0a1b33524bf 100644 --- a/lib/routes/lastfm/top.js +++ b/lib/routes/lastfm/top.js @@ -3,7 +3,7 @@ const config = require('@/config').value; module.exports = async (ctx) => { if (!config.lastfm || !config.lastfm.api_key) { - throw 'Last.fm RSS is disabled due to the lack of relevant config'; + throw 'Last.fm RSS is disabled due to the lack of relevant config'; } const country = ctx.params.country; diff --git a/lib/routes/nhentai/util.js b/lib/routes/nhentai/util.js index dba2af2156e8c6..47001bdd5e6bcb 100644 --- a/lib/routes/nhentai/util.js +++ b/lib/routes/nhentai/util.js @@ -77,7 +77,7 @@ exports.getDetails = (cache, simples) => Promise.all(simples.slice(0, MAX_DETAIL const MAX_TORRENT = 5; exports.getTorrents = async (cache, simples) => { if (!config.nhentai || !config.nhentai.username || !config.nhentai.password) { - throw 'nhentai RSS with torrents is disabled due to the lack of relevant config'; + throw 'nhentai RSS with torrents is disabled due to the lack of relevant config'; } const cookie = await getCookie(config.nhentai.username, config.nhentai.password, cache); if (!cookie) { diff --git a/lib/routes/pixiv/bookmarks.js b/lib/routes/pixiv/bookmarks.js index a49b97e025b830..89b7e88371abf7 100644 --- a/lib/routes/pixiv/bookmarks.js +++ b/lib/routes/pixiv/bookmarks.js @@ -6,7 +6,7 @@ const pixivUtils = require('./utils'); module.exports = async (ctx) => { if (!config.pixiv || !config.pixiv.refreshToken) { - throw 'pixiv RSS is disabled due to the lack of relevant config'; + throw 'pixiv RSS is disabled due to the lack of relevant config'; } const id = ctx.params.id; diff --git a/lib/routes/pixiv/illustfollow.js b/lib/routes/pixiv/illustfollow.js index 0a2ae4a9b59dd8..0c37c0dba4da6e 100644 --- a/lib/routes/pixiv/illustfollow.js +++ b/lib/routes/pixiv/illustfollow.js @@ -5,7 +5,7 @@ const pixivUtils = require('./utils'); module.exports = async (ctx) => { if (!config.pixiv || !config.pixiv.refreshToken) { - throw 'pixiv RSS is disabled due to the lack of relevant config'; + throw 'pixiv RSS is disabled due to the lack of relevant config'; } const token = await getToken(); diff --git a/lib/routes/pixiv/ranking.js b/lib/routes/pixiv/ranking.js index a616171a0c0af0..b35b2bd5927d32 100644 --- a/lib/routes/pixiv/ranking.js +++ b/lib/routes/pixiv/ranking.js @@ -50,7 +50,7 @@ const alias = { module.exports = async (ctx) => { if (!config.pixiv || !config.pixiv.refreshToken) { - throw 'pixiv RSS is disabled due to the lack of relevant config'; + throw 'pixiv RSS is disabled due to the lack of relevant config'; } const mode = alias[ctx.params.mode] ? alias[ctx.params.mode] : ctx.params.mode; diff --git a/lib/routes/pixiv/search.js b/lib/routes/pixiv/search.js index 77b6a4423e1581..8fcb5d93df2364 100644 --- a/lib/routes/pixiv/search.js +++ b/lib/routes/pixiv/search.js @@ -6,7 +6,7 @@ const pixivUtils = require('./utils'); module.exports = async (ctx) => { if (!config.pixiv || !config.pixiv.refreshToken) { - throw 'pixiv RSS is disabled due to the lack of relevant config'; + throw 'pixiv RSS is disabled due to the lack of relevant config'; } const keyword = ctx.params.keyword; diff --git a/lib/routes/pixiv/user.js b/lib/routes/pixiv/user.js index af8c1fb70863b4..e9ff62b09f552e 100644 --- a/lib/routes/pixiv/user.js +++ b/lib/routes/pixiv/user.js @@ -5,7 +5,7 @@ const pixivUtils = require('./utils'); module.exports = async (ctx) => { if (!config.pixiv || !config.pixiv.refreshToken) { - throw 'pixiv RSS is disabled due to the lack of relevant config'; + throw 'pixiv RSS is disabled due to the lack of relevant config'; } const id = ctx.params.id; diff --git a/lib/routes/twitter/likes.js b/lib/routes/twitter/likes.js index c22bfd3d97af37..61aedea3984c48 100644 --- a/lib/routes/twitter/likes.js +++ b/lib/routes/twitter/likes.js @@ -3,7 +3,7 @@ const config = require('@/config').value; module.exports = async (ctx) => { if (!config.twitter || !config.twitter.consumer_key || !config.twitter.consumer_secret) { - throw 'Twitter RSS is disabled due to the lack of relevant config'; + throw 'Twitter RSS is disabled due to the lack of relevant config'; } const id = ctx.params.id; const result = await utils.getTwit().get('favorites/list', { diff --git a/lib/routes/twitter/list.js b/lib/routes/twitter/list.js index 863a17a129604d..868c3195c0292c 100644 --- a/lib/routes/twitter/list.js +++ b/lib/routes/twitter/list.js @@ -3,7 +3,7 @@ const config = require('@/config').value; module.exports = async (ctx) => { if (!config.twitter || !config.twitter.consumer_key || !config.twitter.consumer_secret) { - throw 'Twitter RSS is disabled due to the lack of relevant config'; + throw 'Twitter RSS is disabled due to the lack of relevant config'; } const { id, name } = ctx.params; diff --git a/lib/routes/twitter/trends.js b/lib/routes/twitter/trends.js index 551b67a5754bdc..f69dd7fe8d73c9 100644 --- a/lib/routes/twitter/trends.js +++ b/lib/routes/twitter/trends.js @@ -3,7 +3,7 @@ const config = require('@/config').value; module.exports = async (ctx) => { if (!config.twitter || !config.twitter.consumer_key || !config.twitter.consumer_secret) { - throw 'Twitter RSS is disabled due to the lack of relevant config'; + throw 'Twitter RSS is disabled due to the lack of relevant config'; } const woeid = ctx.params.woeid || 1; // Global information is available by using 1 as the WOEID const result = await utils.getTwit().get('trends/place', { id: woeid }); diff --git a/lib/routes/youtube/channel.js b/lib/routes/youtube/channel.js index cebdde0dbbdd8a..9f304f91064a4c 100644 --- a/lib/routes/youtube/channel.js +++ b/lib/routes/youtube/channel.js @@ -3,7 +3,7 @@ const config = require('@/config').value; module.exports = async (ctx) => { if (!config.youtube || !config.youtube.key) { - throw 'YouTube RSS is disabled due to the lack of relevant config'; + throw 'YouTube RSS is disabled due to the lack of relevant config'; } const id = ctx.params.id; const embed = !ctx.params.embed; diff --git a/lib/routes/youtube/playlist.js b/lib/routes/youtube/playlist.js index bd8b60954749dc..1b9ae7fc686f45 100644 --- a/lib/routes/youtube/playlist.js +++ b/lib/routes/youtube/playlist.js @@ -3,7 +3,7 @@ const config = require('@/config').value; module.exports = async (ctx) => { if (!config.youtube || !config.youtube.key) { - throw 'YouTube RSS is disabled due to the lack of relevant config'; + throw 'YouTube RSS is disabled due to the lack of relevant config'; } const id = ctx.params.id; const embed = !ctx.params.embed; diff --git a/lib/routes/youtube/user.js b/lib/routes/youtube/user.js index 56f400c631916c..8c68f45561208c 100644 --- a/lib/routes/youtube/user.js +++ b/lib/routes/youtube/user.js @@ -3,7 +3,7 @@ const config = require('@/config').value; module.exports = async (ctx) => { if (!config.youtube || !config.youtube.key) { - throw 'YouTube RSS is disabled due to the lack of relevant config'; + throw 'YouTube RSS is disabled due to the lack of relevant config'; } const username = ctx.params.username; const embed = !ctx.params.embed; diff --git a/lib/v2/telegram/stickerpack.js b/lib/v2/telegram/stickerpack.js index 6dcd18b7cca26b..2a64f170f652a4 100644 --- a/lib/v2/telegram/stickerpack.js +++ b/lib/v2/telegram/stickerpack.js @@ -3,7 +3,7 @@ const config = require('@/config').value; module.exports = async (ctx) => { if (!config.telegram || !config.telegram.token) { - throw 'Telegram Sticker Pack RSS is disabled due to the lack of relevant config'; + throw 'Telegram Sticker Pack RSS is disabled due to the lack of relevant config'; } const name = ctx.params.name;