How to handle invalid routing in polymer - polymer

In this case https://localhost/invalid/ I can catch the event at polymer app-router and redirect to customized 404 html page.
In this case https://localhost/invalid.txt I can't catch the event at polymer app-router. server will look for the file and throws an error ENOENT: no such file or directory, stat ENOENT: no such file or directory, stat '/usr/src/app/build/bundled/invalid.txt'
How can i handle and re-route it.

Related

No files matching the pattern "**/*.{css,scss}" were found

I am using Github and linters and with style linters its showing me this error:
Error: No files matching the pattern "**/*.{css,scss}" were found.
at /home/runner/work/Microverse-Airline/Microverse-Airline/node_modules/stylelint/lib/standalone.js:212:12
at processTicksAndRejections (internal/process/task_queues.js:97:5)
Error: Process completed with exit code 1.
Here is the link to my github repository: https://github.com/saqibjavaiddev/Microverse-Airline/pull/24

firebase functions deploy got an error with file path that contains "\"

When I tried to deploy firebase functions, the process of loading credential file occurs an error:
Detailed stack trace: Error: Failed to read credentials from file C:\Users\kracc\Desktop\code\glint-server\firebase-account.json: Error: ENOENT: no such file or directory, open 'C:\Users\kracc\Desktop\code\glint-server\firebase-account.json'
Initialization code:
private connectFireStore(): void {
initializeApp({
credential: applicationDefault(),
databaseURL: process.env.FIRESTORE_URL,
})
}
folder structure:
and value of GOOGLE_APPLICATION_CREDENTIALS in .env.prod is ../../firebase-account.json
I can open C:\Users\kracc\Desktop\code\glint-server\firebase-account.json and it works well when I use emulator and local server
reason why I think the backslash matters is I saw it couldn't understand backslash included path in require function (require('./lib\\foo') got an error).
how can I deal with this situation?

Handle nonexistent PWD gracefully

Whenever I execute a crystal program in a directory that does not exists, it fails with Unhandled exception: getcwd: No such file or directory (Errno). I can't find the way to handle such case gracefully, is it possible?

Jekyll: ERROR files not found

I just setup a local jekyll instance for github pages. After following all the instructions on GitHub and getting all the files into the local repository, I ran jekyll (sudo bundle exec jekyll serve).
I get the following errors:
^CSeans-MacBook-Air:docs-gh-pages seanmcintyre$ sudo bundle exec jekyll serve
Password:
Configuration file: none
Configuration file: none
Source: /Users/SnapRouteDocs/docs-gh-pages
Destination: /Users/SnapRouteDocs/docs-gh-pages/_site
Incremental build: disabled. Enable with --incremental
Generating...
done in 0.82 seconds.
Auto-regeneration: enabled for '/Users/SnapRouteDocs/docs-gh-pages'
Configuration file: none
Server address: http://127.0.0.1:4000/
Server running... press ctrl-c to stop.
[2017-04-13 13:35:12] ERROR `/_static/js/modernizr.min.js' not found.
[2017-04-13 13:35:12] ERROR `/_static/js/theme.js' not found.
[2017-04-13 13:35:12] ERROR `/_static/doctools.js' not found.
[2017-04-13 13:35:12] ERROR `/_static/jquery.js' not found.
[2017-04-13 13:35:12] ERROR `/_static/underscore.js' not found.
[2017-04-13 13:35:17] ERROR `/_static/css/theme.css' not found.
[2017-04-13 13:35:17] ERROR `/_static/jquery.js' not found.
[2017-04-13 13:35:17] ERROR `/_static/underscore.js' not found.
[2017-04-13 13:35:17] ERROR `/_static/doctools.js' not found.
[2017-04-13 13:35:17] ERROR `/_static/js/theme.js' not found.
I've checked and all the files are actually there.
How do I go about fixing this?
Prob because Jekyll doesn't know about them, so they're not compiling into the build folder, _site. Try adding this in the _config.yml file:
include:
- _static
If that doesn't work, just remove the underscore and Jekyll will automatically include in the build. That's prob best way anyway.
In addition to #keruilin's answer, Jekyll errors such as
ERROR `/resources/biokdd-review-nlp.htm' not found.
are sometimes simply due to a malformed web URL, in one of your Jekyll-built site pages that are open in your browser. Check the open webpages, and reload.
In my case (for instance) if I manually / erroneously open the malformed URL
127.0.0.1:4000/resources/biokdd-review-nlp. html
(note the space before .html I get that Jekyll error, until I correct the URL and reload the page.

Load new module in Kamailio

I would like to ask, how can I load new module in Kamailio 4.1.2?
Actually, I have an issue, when I tried to compile my kamaiio.cfg
I've got error:
root#kamailio:/usr/local/# kamailio -c kamailio.cfg
loading modules under /usr/local/lib64/kamailio/modules/
0(25392) ERROR: <core> [sr_module.c:587]: load_module(): ERROR: load_module: could not find module <websocket> in </usr/local/lib64/kamailio/modules/>
0(25392) : <core> [cfg.y:3408]: yyerror_at(): parse error in config file /usr/local/etc/kamailio/kamailio.cfg, line 323, column 12-25: failed to load module
0(25392) ERROR: <core> [cfg.y:3272]: yyparse(): cfg. parser: failed to find command ws_handle_handshake
0(25392) : <core> [cfg.y:3411]: yyerror_at(): parse error in config file /usr/local/etc/kamailio/kamailio.cfg, line 1083, column 27: unknown command, missing loadmodule?
ERROR: bad config file (2 errors)
when I look physically to the /usr/local/lib64/kamailio/modules/ there is some modules, but websocket.so is missing.
So, how can I get and load module in Kamailio?
Thank you for help!
You haven't installed the module websocket. Edit modules.lst file in the source code directory and add websocket to include_modules variable. If you don't have modules.lst, just do:
make cfg
Alternative is to do:
make cfg include_modules="websocket"
By default, the build system for kamailio compiles and install only the modules that have the same dependencies as the core of the application. For websocket you need to install libunistring and openssl (libssl) devel packages.
Steps to load new module to Kamailio server. (Try if above answer is not working for you)
Check the modules is exist in the default module directly /usr/local/lib64/kamailio/modules.
If found, add loadmodule "module_name.so" in load module section in kamailio.cfg file.
If the module is not found in default module directory, you can check for the source code of that module in the default module source code directory /usr/local/src/kamailio-4.4/kamailio/modules.
If source code found, enter to the module directory. Then create modules' shared object file(.so) by following commands.
./configure
make
make test
make install
Then you will get a shared object file(.so). Copy that file into the default module directory. and load this module from the kamailio.cfg file as mentioned in step 1.
If module source code does not exist in the default source code directory, You need to download the source code from the web. And follow step 3 and 4.