Comments (2)
IMO the issue not even in logging ImportError (although this does help a bit), but because the error handling isn't robust enough.
There are actually multiple issues here at the same time:
Lines 41 to 50 in 698333c
-
the first import fails due to the
MAX_MESSAGE_LENGTH
issue
ImportError: cannot import name 'MAX_MESSAGE_LENGTH' from 'telegram.constants'
-
since
ImportError
is very broad (it doesn't check that the name of the module in exception isntry.backedns.telegram
), it tries to handle the errorimo
.args
or.name
for the exception object should be checked first, and if it's unrelated to the backend itself, it should be simply rethrown so it's clear what's the actual error. -
then for some reason the code tries to import the backend as
telegram
not sure what the idea here, in case you wrote a backend and don't want it under
ntfy.backends.*
namespace? -
which actually works because
telegram
is a library which accesses telegram API, but not a notify backendimo here right after importing we should check if the module we imported contains
.notify
function. If not, it's not a ntfy backend and the original Exception should be rethrown (again so there is less indirection and easier to understand what actually failed)
from ntfy.
Overall, even if you hack around the issue above with MAX_MESSAGE_LENGTH
, sending messages to telegram still doesn't work and telegram_send
library seems abandoned. So likely we need to switch to something else :( rahiel/telegram-send#121
from ntfy.
Related Issues (20)
- Base path HOT 1
- emojize() got an unexpected keyword argument 'use_aliases' HOT 4
- Google chat and Signal support
- Not auto starting after reboot
- Can not use shell variable as message HOT 2
- how to uninstall in ubuntu?
- Support python3.11 HOT 1
- feature: support customizing icons depending on the result code
- Ignoring VS Code
- incompatible with python 3.11 HOT 6
- How this works? HOT 1
- use Slixmpp instead of SleekXMPP
- ttl support w/Pushover
- Add end-to-end encryption support to SimplePush
- Commands prefixed by space are still logged in `.bash_history`
- Move AUTO_NTFY_DONE_IGNORE config to the yaml file
- Error while trying to install ntfy in termux HOT 1
- feat(log): Add a logging handler for use from Python HOT 1
- Issue with using telegram backend
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ntfy.