Add error method for provider.

Conflicts:
	test/provider.js
fixed error in provider error test