use ErrorModes around your FileCopy

Started by kdmoyers, February 04, 2015, 06:04:38 AM

Previous topic - Next topic

kdmoyers

Tony, in a recent thread response you mentioned
Quoteuse ErrorModes around your FileCopy
I've had bad luck with that particular trick.  It seems that some of the network copy errors I tend to get are not trapped by the errormode(@off). For example, if I copy a file to a printer on a remote machine (like \\TD4\ClericalLab ) and that machine TD4 is not turned on, that makes a hard fatal error.
Unfortunately, I don't have a workaround to recommend. 

Could the error trapping on FileCopy be made more inclusive? just a suggestion.

-Kirby
The mind is everything; What you think, you become.

td

In the context of the previous post about copying files to a shared folder, FileCopy will generate a 1008 error if the share is unavailable and ErrorMode traps 1000 level errors.  In fact, I am not aware of any FileCopy generated errors that are not in the 1000 error  level  except for the error 3473 when you specify @True in the third parameter while running in background mode.  So perhaps you are referring to some kind of system exception?  If that is the case then it would be wise to implement a test of some kind to determine if the resource is available before attempting to send a file to a remote printer. 

If on the other hand  you experience a 3000 level error when coping to a printer (wouldn't be the first time I missed something) then you could use IntControl 73 error handling.

"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

kdmoyers

got it, Thanks.  I'll do some experimenting.
-K
The mind is everything; What you think, you become.

kdmoyers

The mind is everything; What you think, you become.