Error-correcting pairs are calculated explicitly for an arbitrary algebraic-geometric code and its dual code. Such a pair consists of codes that are necessary for an effective decoding algorithm for a given code. The type of pairs depends on the degrees of divisors with which both the original code and one of the codes from error-correcting pair are constructed. So for the algebraic-geometric code $\mathcal{C}_{\mathcal{L}}(D,G)$ of the length $n$ associated with a functional field $F/\mathbb{F}_q$ of genus $g$ the error-correcting pair with number of errors $t=\lfloor (n-\deg(G)-g-1)/{2} \rfloor$ is $(\mathcal{C}_{\mathcal{L}}(D,F), \mathcal{C}_{\mathcal{L}}(D,G+F)^\bot)$ or $(\mathcal{C}_{\mathcal{L}}(D,F)^\bot,\mathcal{C}_{\mathcal{L}}(D,F-G))$. For the dual code $\mathcal{C}_{\mathcal{L}}(D,G)^\bot$ the error-correcting pair with number of errors $t=\lfloor (\deg(G)-3g+1)/{2} \rfloor$ is $(\mathcal{C}_{\mathcal{L}}(D,F),\mathcal{C}_{\mathcal{L}}(D,G-F))$. Considering each component of pair as MDS-code, we obtain additional conditions on the degrees of the divisors $G$ and $F$. In addition, error-correcting pairs are calculated for subfield subcodes $\mathcal{C}_{\mathcal{L}}(D,G)|_{\mathbb{F}_p}$ and $\mathcal{C}_{\mathcal{L}}(D,G)^\perp|_{\mathbb{F}_p}$, where $\mathbb{F}_p$ is a subfield of $\mathbb{F}_q$. The form of a first component in the pair depends on the degrees of the divisors $G$ and $F$ and, in some cases, on the genus $g$.