Question: catch "wrong type of arguments"

Any idea how I catch that error?

(in geometry:-DefinedAs) wrong type of argument |C:/Users/andreas/AppData/Local/Temp/com.maplesoft/NODELibrary-0dc05fe4-0ffc9cfc/lib/NODEFunctions-13751:1976|

Here's the code:

    try
        a := map(coordinates, DefinedAs(segm))[1];
        b := map(coordinates, DefinedAs(segm))[2];
    catch "wrong type of arguments":
        Alert(cat("Error, (in geometry:-DefinedAs) wrong type of arguments, variable segm: ", whattype(segm), segm), table(), 5)
    end try;

Please Wait...