The use of > redirects the output of dmesg away from standard output (ie. the screen), to a file called error.txt. As you did not specify a path, it will be in whatever directory you were in when you issued the command.
To try and find it, you could use:
find -name error.txt
Hope this helps.