DOC: Make sphinx fail the build when --warnings-are-errors is set
State: closed

xref #22743 

We already had an option `--warnings-are-errors` in `doc/make.py`, but it was making the doc build cancel after the first warning was found, generating a Python exception. Changed to finish the build, and not raise any error, but exit with 1.

Also, when building a single document, ignore the broken reference warnings (they are broken because we don't build the referenced documents).


Labels:
name: Docs

Comments:
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/24523?src=pr&el=h1) Report
> Merging [#24523](https://codecov.io/gh/pandas-dev/pandas/pull/24523?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/bf9d41c8f211fdd9e2b1a37162b753d3845a6708?src=pr&el=desc) will **not change** coverage.
> The diff coverage is `n/a`.

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

```diff
@@           Coverage Diff           @@
##           master   #24523   +/-   ##
=======================================
  Coverage   31.88%   31.88%           
=======================================
  Files         166      166           
  Lines       52434    52434           
=======================================
  Hits        16718    16718           
  Misses      35716    35716
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `30.28% <ø> (ø)` | :arrow_up: |
| #single | `31.88% <ø> (ø)` | :arrow_up: |


------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/24523?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/24523?src=pr&el=footer). Last update [bf9d41c...d66397a](https://codecov.io/gh/pandas-dev/pandas/pull/24523?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/24523?src=pr&el=h1) Report
> Merging [#24523](https://codecov.io/gh/pandas-dev/pandas/pull/24523?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/bf9d41c8f211fdd9e2b1a37162b753d3845a6708?src=pr&el=desc) will **not change** coverage.
> The diff coverage is `n/a`.

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

```diff
@@           Coverage Diff           @@
##           master   #24523   +/-   ##
=======================================
  Coverage   31.88%   31.88%           
=======================================
  Files         166      166           
  Lines       52434    52434           
=======================================
  Hits        16718    16718           
  Misses      35716    35716
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `30.28% <ø> (ø)` | :arrow_up: |
| #single | `31.88% <ø> (ø)` | :arrow_up: |


------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/24523?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/24523?src=pr&el=footer). Last update [bf9d41c...d66397a](https://codecov.io/gh/pandas-dev/pandas/pull/24523?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

thanks!