You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 22, 2024. It is now read-only.
Repository navigation
This repository was archived by the owner on Nov 22, 2024. It is now read-only.
@vikerman and I discussed this separately but for the sake of documentation:
There is no good way to determine if an error happened. Angular already implements its own error handler and it is too high up the tree for us to provide our own. We would need to make a change to angular/angular to allow us to pass in our own error handler.
Maybe the issue is actually here. Instead of just rejecting the promise, can that error be stringified and logged? I have no idea what is going wrong in my rendering because all I get is [Error] in the output.
@chris13524 First - sorry for the delayed response! The code in index.ts happens if we send a message with success: false. This kind of message only gets sent from render.ts when there is an error writing the rendered html to the file system.
So in summary, the code you pointed out is catching & logging errors that happen when writing the rendered output to the file system. What we want is to catch errors that happen while we are rendering the output, but angular is already catching these errors and there's currently no way for us to detect them.
@s2young Likewise, the errors you get when rendering would be originating from here. The errors caught here won't be providing you info about what's going wrong in the rendering.
Thanks for the response. I guess the bigger issue for me right now is 17021. I can't use prerendering at all until it's actually building output like ng build.
Depending on your scenario, this script may be a hack/workaround for detecting an error.
#!/usr/bin/env bash
result=$(ng run univ:prerender --routes /about 2>&1)if [[ $result==*"ERROR"* ]];thenecho"There was an error in prerendering:"echo"$result"exit 1
fi
Reacted by Richard Korebrits
Reacted by Richard Korebrits and William Desportes
Activity
wagnermaciel commentedon Jan 21, 2020
@vikerman and I discussed this separately but for the sake of documentation:
There is no good way to determine if an error happened. Angular already implements its own error handler and it is too high up the tree for us to provide our own. We would need to make a change to angular/angular to allow us to pass in our own error handler.
chris13524 commentedon Feb 9, 2020
@wagnermaciel what's the code here supposed to do, then?
I also get errors logged to the console but it doesn't tell me from which route it originated from (like the linked code is supposed to).
s2young commentedon Mar 3, 2020
Maybe the issue is actually here. Instead of just rejecting the promise, can that error be stringified and logged? I have no idea what is going wrong in my rendering because all I get is [Error] in the output.
wagnermaciel commentedon Mar 5, 2020
@chris13524 First - sorry for the delayed response! The code in index.ts happens if we send a message with
success: false. This kind of message only gets sent from render.ts when there is an error writing the rendered html to the file system.So in summary, the code you pointed out is catching & logging errors that happen when writing the rendered output to the file system. What we want is to catch errors that happen while we are rendering the output, but angular is already catching these errors and there's currently no way for us to detect them.
@s2young Likewise, the errors you get when rendering would be originating from here. The errors caught here won't be providing you info about what's going wrong in the rendering.
s2young commentedon Mar 6, 2020
Thanks for the response. I guess the bigger issue for me right now is 17021. I can't use prerendering at all until it's actually building output like ng build.
craheb commentedon Sep 16, 2020
Depending on your scenario, this script may be a hack/workaround for detecting an error.
alan-agius4 commentedon May 22, 2023
Duplicate of angular/angular#33642
angular-automatic-lock-bot commentedon Jun 22, 2023
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.