This does actually work, it's just woeful:

This does actually work, it's just woeful:

    except
      on E: Exception do
      begin
        if E.ClassType = EOSError then
        begin
          // Ignore
        end
        else
        begin
          raise;
        end;
      end;
    end;


Other people might be tempted to write:

  except
    on EOSError do ;
  end;

The whole "every block must have a begin-end pair" rule leads to a certain amount of silliness that makes this sort of code look worse. I'm also not convinced that silently failing is a good idea in this case, but that's another whinge...

Comments

  1. I have some WaitAndRetryWare in my code too :)

    ReplyDelete
  2. Try "retract the label" "twiddle the ribbon position" "realign the print head" "change roller tension" and about 20 other things you could do in software. The printer was seriously magic and I loved it, but discovering by trial and error how to resolve the plethora of errors was tedious. We went through about 10 different $5000+ printers before we found that one, and I am sure at least one was destroyed by an angry user. Nothing like printing a 10cm x 30cm label then finding it separated from the backing and glued all over the rollers, print head and printer internals to make the user clear it out with a hammer. But set the thing up just right and the labels fall onto the box in just the right place and the "label man" can just sit there with a roller in their hand pressing them down so they stick. We ran two printers side by side in a sliding mount so they could be swapped quickly when they jammed. When I got that system working I felt like a magician - previously there were several people and a table full of printers doing that job, with the error rate you would expect.

    ReplyDelete
  3. We use a lot of quirky SATO printers with various methods of application (arm, brush, pneumatics, etc) that people have a love/hate relationship with... things can fail in the most peculiar way.

    ReplyDelete

Post a Comment