The t_error() function is used to handle lexing errors that occur when illegal characters are detected. My question is: How can I use this function to get more specific information on errors? Like error type, in which rule or section the error appears, etc.
In general, there is only very limited information available to the t_error() function. As input, it receives a token object where the value has been set to the remaining input text.   Analysis of that text is entirely up to you.   You can use the t.lexer.skip(n) function to have the lexer skip ahead by a certain number of characters and that's about it. 
There is no notion of an "error type" other than the fact that there is an input character that does not match the regular expression of any known token.  Since the lexer is decoupled from the parser, there is no direct way to get any information about the state of the parsing engine or to find out what grammar rule is being parsed.  Even if you could get the state (which would simply be the underlying state number of the LALR state machine), interpretation of it would likely be very difficult since the parser could be in the intermediate stages of matching dozens of possible grammar rules looking for reduce actions.
My advice is as follows:  If you need additional information in the t_error() function, you should set up some kind of object that is shared between the lexer and parser components of your code.  You should explicitly make different parts of your compiler update that object as needed (e.g., it could be updated in specific grammar rules).
Just as aside, there are usually very few courses of action for a bad token.   Essentially, you're getting input text that doesn't any known part of the language alphabet (e.g., no known symbol).   As such, there's not even any kind of token value you can give to the parser.  Usually, the only course of action is to report the bad input, throw it out, and continue.
As a followup to Raymond's answer, I would also not advise modifying any attribute of the lexer object in t_error().
lexer error-handling PLY Python