#
# <20220529.1440.57>
#
# This module defines known errors for the bgerror routine in
# fr. It queries this each time an error presents.
#
namespace eval knownErrors {
  # This (1st) error fixed in newer tk, not in the freewrap version yet.
  variable ignoreThese\
      [list\
	   {Duplicate element ComboboxPopdownFrame.border} \
	   {can't read "ftp(Dir)": no such element in array}\
           {NoReport}\
	   {*\[sudo\] password for *:*}\
            {invalid command name ".toplevel_*.text"}
	  ]
}
# if called with "returnError" in args we return 1 if the error
# is known.

proc IsKnownError {err args} {
    
  foreach ignor $::knownErrors::ignoreThese {
    if {[string match *${ignor}* $err]} {
	  if {"returnError" in $args} {return 1}
      LogSilent "Ignoring Error: $::errorInfo"
      return -code return
    }
  }
  return 0
}
