mirror of
https://github.com/whyour/qinglong.git
synced 2025-12-15 08:25:38 +08:00
Improve error messages for QLAPI initialization
Co-authored-by: whyour <22700758+whyour@users.noreply.github.com>
This commit is contained in:
parent
16b20e8b54
commit
eab8a93f28
|
|
@ -27,9 +27,15 @@ if (typeof QLAPI === 'undefined') {
|
|||
};
|
||||
} catch (error) {
|
||||
console.error(
|
||||
'Failed to initialize QLAPI. Please run this script using the "task" command or add it as a scheduled task.',
|
||||
'\n❌ Failed to initialize QLAPI. This usually happens because:',
|
||||
);
|
||||
console.error('Example: task ql_sample.js');
|
||||
console.error(' 1. The Qinglong backend is not running');
|
||||
console.error(' 2. Required files are not yet generated\n');
|
||||
console.error(
|
||||
'Solution: Use the "task" command instead of running directly:',
|
||||
);
|
||||
console.error(' Example: task ql_sample.js');
|
||||
console.error(' Or add this script as a scheduled task in the panel\n');
|
||||
console.error('Error details:', error.message);
|
||||
process.exit(1);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,8 +29,12 @@ except NameError:
|
|||
|
||||
QLAPI = BaseApi()
|
||||
except Exception as error:
|
||||
print('Failed to initialize QLAPI. Please run this script using the "task" command or add it as a scheduled task.')
|
||||
print('Example: task ql_sample.py')
|
||||
print('\n❌ Failed to initialize QLAPI. This usually happens because:')
|
||||
print(' 1. The Qinglong backend is not running')
|
||||
print(' 2. Required files are not yet generated\n')
|
||||
print('Solution: Use the "task" command instead of running directly:')
|
||||
print(' Example: task ql_sample.py')
|
||||
print(' Or add this script as a scheduled task in the panel\n')
|
||||
print(f'Error details: {error}')
|
||||
sys.exit(1)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user