Error output in txt file
Error output in txt file
Hi,
Newbie here. Trying to figure out a way to write out errors in a text file. Now i use the conditional node but how do i specify the exact error that the worflow fails on and pass that error out in the text file? My solution would be to only include one operation pr conditional like comparing framerate and if it fails it'll write out an txt with a framerate error. But if i had several errors it would only write out the first one and the node tree is going to be really long.
So checking a file for the right codec, framerate, bitrate etc and passing all the errors out in a txt file is what i want to do.
Thanks
Newbie here. Trying to figure out a way to write out errors in a text file. Now i use the conditional node but how do i specify the exact error that the worflow fails on and pass that error out in the text file? My solution would be to only include one operation pr conditional like comparing framerate and if it fails it'll write out an txt with a framerate error. But if i had several errors it would only write out the first one and the node tree is going to be really long.
So checking a file for the right codec, framerate, bitrate etc and passing all the errors out in a txt file is what i want to do.
Thanks
Re: Error output in txt file
Hey Larsdp,
welcome to the forum and thank you for using ffastrans!
What you can do is to set your text file processor to execute "on error" instead of success (rightclick the input pin) - connect all your conditionals to this text proc.
The content of the text proc is just %s_error% in this case.
Lemme know if it works for you!
welcome to the forum and thank you for using ffastrans!
What you can do is to set your text file processor to execute "on error" instead of success (rightclick the input pin) - connect all your conditionals to this text proc.
The content of the text proc is just %s_error% in this case.
Lemme know if it works for you!
emcodem, wrapping since 2009 you got the rhyme?
Re: Error output in txt file
Hi!
Thanks, it works but the error message is not that user friendly. I'm gettin "Conditional@Desktop: 1st evalutation of " = OP1a is " = OP1a"
Now i'm inputing a mp4 so my goal if possible is to write something out like, "wrong file container, wrong frame rate etc" like all erros in one txt file.
But maybe the point is that i have to write all the checks out into seperate nodes (one node for framerate etc)and then the workflow stops when a condition is not met?
Thanks, it works but the error message is not that user friendly. I'm gettin "Conditional@Desktop: 1st evalutation of " = OP1a is " = OP1a"
Now i'm inputing a mp4 so my goal if possible is to write something out like, "wrong file container, wrong frame rate etc" like all erros in one txt file.
But maybe the point is that i have to write all the checks out into seperate nodes (one node for framerate etc)and then the workflow stops when a condition is not met?
Re: Error output in txt file
Hm, i'd probably try to save nodes,, try this wofklow and let me know any questions
In the first populate proc, i do one check per line like this:
%i_width% = 720 ? "" : "Video Width error, actual width %i_width%"
What it does is on the left side of the ?, it checks some condition, e.g. %i_width% = 720
On the right side, we have two options divided by the :
Left option happens when the condition on the left is true, right happens when it's false. This way, the user variable %s_custom_error% would contain a corresponding error message or it stays empty.
After all the checks, i use a conditional to see if s_custom_error is empty.
In the first populate proc, i do one check per line like this:
%i_width% = 720 ? "" : "Video Width error, actual width %i_width%"
What it does is on the left side of the ?, it checks some condition, e.g. %i_width% = 720
On the right side, we have two options divided by the :
Left option happens when the condition on the left is true, right happens when it's false. This way, the user variable %s_custom_error% would contain a corresponding error message or it stays empty.
After all the checks, i use a conditional to see if s_custom_error is empty.
emcodem, wrapping since 2009 you got the rhyme?
Re: Error output in txt file
Thanks! That's next level I think i'll be quiet now for a while trying to look through it and learn.
Re: Error output in txt file
Hehe working with variables makes you very mighty.
Besides the ? : syntax i explained above, one special thing the workflow does is to set %s_success% to %s_custom_error%. This is only to display the content of the variable %s_custom_error% on the job monitor's outcome column when the job has finished. Sure you'd want to replace the populate processor that happens "on error" after the conditional by your write text file node.
Besides the ? : syntax i explained above, one special thing the workflow does is to set %s_success% to %s_custom_error%. This is only to display the content of the variable %s_custom_error% on the job monitor's outcome column when the job has finished. Sure you'd want to replace the populate processor that happens "on error" after the conditional by your write text file node.
emcodem, wrapping since 2009 you got the rhyme?
Re: Error output in txt file
Okay, so now i got to understand it a bit better. Question: the variable %s_custom_error% in the first node should there be two with the same name or should i create one pr condition test? It seems like a only get one error written out to the text file when using %s_custom_error% i'm testing a file with several errors so it should read multiple lines with framereate error and size error
Re: Error output in txt file
Great, that was fast progress, congrats
You can just add %s_custom_error% whenever you set a new value to s_custom_error, i used an | symbol to separate the different errors above.
This way, the messages get appended. Of course we also need to set s_custom_error NOT to "" in case the contition succeds, but instead we set it to "%s_custom_error%", so it retains the current value
If you later need to format the list, you can just replace the | symbol by @CRLF.
The stuff with @CRLF is a little hard to explain, it is a global variable in the programming language that ffastrans is written in and stands for newline.
So, when all checks are done, in the populate proc at start, just do this as last thing:
%s_custom_error% = $replace("%s_custom_error%","|",@CRLF)
This way, %s_custom_error% will contain each single error separated by newline.
Sidenote:
Note the use of "" around any variable that is of type s_ . This is something you got to do whenever you insert s_ variables anywhere, they always need to be enclosed in "", e.g. "%s_source%". i_ or f_ variable types are numbers and therefore do not need to be enquoted, e.g. %i_width%
Code: Select all
%i_width% = 720 ? "%s_custom_error%" : "Video Width error, actual width %i_width% | %s_custom_error%"
This way, the messages get appended. Of course we also need to set s_custom_error NOT to "" in case the contition succeds, but instead we set it to "%s_custom_error%", so it retains the current value
If you later need to format the list, you can just replace the | symbol by @CRLF.
The stuff with @CRLF is a little hard to explain, it is a global variable in the programming language that ffastrans is written in and stands for newline.
So, when all checks are done, in the populate proc at start, just do this as last thing:
%s_custom_error% = $replace("%s_custom_error%","|",@CRLF)
This way, %s_custom_error% will contain each single error separated by newline.
Sidenote:
Note the use of "" around any variable that is of type s_ . This is something you got to do whenever you insert s_ variables anywhere, they always need to be enclosed in "", e.g. "%s_source%". i_ or f_ variable types are numbers and therefore do not need to be enquoted, e.g. %i_width%
emcodem, wrapping since 2009 you got the rhyme?
Re: Error output in txt file
Thanks, you got me again, need to sit down with a cup of coffee now. Thanks for helping me out!
Re: Error output in txt file
Everything works perfect but i'm getting this in my text file:
Video height error, actual width 720
Video Width error, actual width 720
%s_custom_error%
So the %s_custom_error% varible is not being terminate or (not sure what is called). Do i remove that also by using the replace function?
Video height error, actual width 720
Video Width error, actual width 720
%s_custom_error%
So the %s_custom_error% varible is not being terminate or (not sure what is called). Do i remove that also by using the replace function?