Add defensive check for argument errors keyword in to_numeric
State: closed

- [x] closes #26394 
- [x] tests passed
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [x] Added defensive check for argument `errors` in func `to_numeric`


Labels:
name: Error Reporting
description: Incorrect or improved errors from pandas
name: Numeric Operations
description: Arithmetic, Comparison, and Logical operations

Comments:
@sumanau7 : Thanks for the PR!  Can you add a test and a `whatsnew` entry into `v0.25.0.rst`?
@gfyoung sure i will complete it within next 24 hours and update.
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/26466?src=pr&el=h1) Report
> Merging [#26466](https://codecov.io/gh/pandas-dev/pandas/pull/26466?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/44d5498d8697513b7a4638c62dd711b1539d2335?src=pr&el=desc) will **decrease** coverage by `<.01%`.
> The diff coverage is `100%`.

[![Impacted file tree graph](https://codecov.io/gh/pandas-dev/pandas/pull/26466/graphs/tree.svg?width=650&token=eZ4WkYLtcO&height=150&src=pr)](https://codecov.io/gh/pandas-dev/pandas/pull/26466?src=pr&el=tree)

```diff
@@            Coverage Diff             @@
##           master   #26466      +/-   ##
==========================================
- Coverage   91.74%   91.74%   -0.01%     
==========================================
  Files         174      174              
  Lines       50763    50765       +2     
==========================================
- Hits        46575    46574       -1     
- Misses       4188     4191       +3
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.25% <100%> (ø)` | :arrow_up: |
| #single | `41.69% <0%> (-0.1%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/26466?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/tools/numeric.py](https://codecov.io/gh/pandas-dev/pandas/pull/26466/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvdG9vbHMvbnVtZXJpYy5weQ==) | `100% <100%> (ø)` | :arrow_up: |
| [pandas/io/gbq.py](https://codecov.io/gh/pandas-dev/pandas/pull/26466/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL2dicS5weQ==) | `78.94% <0%> (-10.53%)` | :arrow_down: |
| [pandas/core/frame.py](https://codecov.io/gh/pandas-dev/pandas/pull/26466/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZnJhbWUucHk=) | `97.02% <0%> (-0.12%)` | :arrow_down: |
| [pandas/util/testing.py](https://codecov.io/gh/pandas-dev/pandas/pull/26466/diff?src=pr&el=tree#diff-cGFuZGFzL3V0aWwvdGVzdGluZy5weQ==) | `90.7% <0%> (+0.1%)` | :arrow_up: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/26466?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/26466?src=pr&el=footer). Last update [44d5498...4de3f1a](https://codecov.io/gh/pandas-dev/pandas/pull/26466?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/26466?src=pr&el=h1) Report
> Merging [#26466](https://codecov.io/gh/pandas-dev/pandas/pull/26466?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/44d5498d8697513b7a4638c62dd711b1539d2335?src=pr&el=desc) will **decrease** coverage by `<.01%`.
> The diff coverage is `50%`.

[![Impacted file tree graph](https://codecov.io/gh/pandas-dev/pandas/pull/26466/graphs/tree.svg?width=650&token=eZ4WkYLtcO&height=150&src=pr)](https://codecov.io/gh/pandas-dev/pandas/pull/26466?src=pr&el=tree)

```diff
@@            Coverage Diff             @@
##           master   #26466      +/-   ##
==========================================
- Coverage   91.74%   91.74%   -0.01%     
==========================================
  Files         174      174              
  Lines       50763    50765       +2     
==========================================
- Hits        46575    46573       -2     
- Misses       4188     4192       +4
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.25% <50%> (-0.01%)` | :arrow_down: |
| #single | `41.72% <0%> (-0.07%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/26466?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/tools/numeric.py](https://codecov.io/gh/pandas-dev/pandas/pull/26466/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvdG9vbHMvbnVtZXJpYy5weQ==) | `98.55% <50%> (-1.45%)` | :arrow_down: |
| [pandas/io/gbq.py](https://codecov.io/gh/pandas-dev/pandas/pull/26466/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL2dicS5weQ==) | `78.94% <0%> (-10.53%)` | :arrow_down: |
| [pandas/core/frame.py](https://codecov.io/gh/pandas-dev/pandas/pull/26466/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZnJhbWUucHk=) | `97.02% <0%> (-0.12%)` | :arrow_down: |
| [pandas/util/testing.py](https://codecov.io/gh/pandas-dev/pandas/pull/26466/diff?src=pr&el=tree#diff-cGFuZGFzL3V0aWwvdGVzdGluZy5weQ==) | `90.7% <0%> (+0.1%)` | :arrow_up: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/26466?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/26466?src=pr&el=footer). Last update [44d5498...5bdd8a4](https://codecov.io/gh/pandas-dev/pandas/pull/26466?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

@gfyoung Is it good now ?
@sumanau7 thanks a lot!