
830 So.2d 505 (2002)
Yoshi Chambers THOMPSON, Plaintiff-Appellant,
v.
JACKSON PARISH POLICE JURY, et al., Defendants-Appellees.
No. 36,497-CA.
Court of Appeal of Louisiana, Second Circuit.
October 23, 2002.
*507 Hammonds & Sills, by Jon K. Guice, Monroe, Oscar P. Barnes, III, for Appellant.
Gold, Weems, Bruser, Sues & Rundell, by Sam N. Poole, Jr., Trevor S. Fry, Alexandria, for Appellees.
Before GASKINS, KOSTELKA and DREW, JJ.
GASKINS, J.
The plaintiff, Yoshi Chambers Thompson, appeals from a trial court judgment granting the exception of res judicata filed by defendants, the Jackson Parish Police Jury (JPPJ) and David McManus. For the following reasons, we affirm.

FACTS
Ms. Thompson was employed by the JPPJ as a scale clerk at the Jackson Parish landfill. Her duties included the weighing of vehicles entering and leaving the landfill as well as routine office management. In 1996, Ms. Thompson signed an agreement with the JPPJ to comply with the JPPJ's drug and alcohol policy. This policy provided, in pertinent part:
3.02 JACKSON PARISH POLICE JURY EMPLOYEES
Employees of the Jackson Parish Police Jury shall be required to submit to alcohol and drug screening [sic] test in the following instances:
1. As part of a random screening without prior notification of date or time.
....
5. PENALTIES
Failure to comply with the intent of the policies and procedures set forth therein shall result in the employee being subject to suspension or termination of his/her employment.
It is mandatory that any employee whose name is on the random list shall indeed be tested that day regardless of circumstances (except in the case of severe *508 illness and vacations out of town). Failure to comply will result in the automatic termination of employment.
On November 17, 1997, Ms. Thompson was at home on her day off. Early, that morning her supervisor, Jimmy Pylant, called her and told her to come into work to submit to a random drug screening. According to Mr. Pylant, Ms. Thompson told him that her car had no antifreeze but she would be in later that morning. About 35 minutes later, when Ms. Thompson had not arrived, Mr. Pylant called Ms. Thompson again. Pylant said that Ms. Thompson's husband, Leslie Thompson, (a member of the JPPJ) answered the phone and said that Ms. Thompson could not come in because her car was inoperable. Ms. Thompson was unable to find a ride to her work place that day because the people she ordinarily rode with had already gone to work. Ms. Thompson apparently offered to submit to the drug test at her home, but the tester did not go to Ms. Thompson's home.
Mr. Pylant reported Ms. Thompson to the JPPJ and, upon the recommendation of the JPPJ, Mr. Pylant suspended Ms. Thompson without pay until a final decision could be made regarding her continued employment. On December 15, 1997, the JPPJ voted to terminate Ms. Thompson's employment and she was fired.
In addition to the missed drug test, the termination of Ms. Thompson had another component. According to the testimony of Dr. Charles Garrett, a member of the personnel committee, the JPPJ also planned to "reorganize" Ms. Thompson's job because "she was spending all of her time inside. That was all she was doing, was running the scales and weighing stuff and we decided to reorganize the office job." After Ms. Thompson was fired, the JPPJ hired another woman who performed Ms. Thompson's duties and, in addition, worked outside. This new employee had a commercial drivers' license and operated a "boom truck." After this replacement left the employ of the JPPJ, another replacement was hired who did not have a commercial drivers' license, but who also worked outside.
After she was fired, Ms. Thompson applied for unemployment benefits. Initially, the JPPJ opposed the payment of benefits on the grounds that she had been terminated for misconduct. The JPPJ claimed that it was approached on behalf of Ms. Thompson in an effort to settle the matter. On December 15, 1997 (JPPJ) and December 18, 1997 (Ms. Thompson), the parties entered into an agreement concerning her termination, her unemployment benefits and her litigious rights against the JPPJ. The agreement specified in part:
WHEREAS EMPLOYER believes that the actions of EMPLOYEE have been such as would fully justify the termination of her employment for cause, including but not limited to failure to comply with EMPLOYER'S personnel policy; and
WHEREAS EMPLOYEE believes that she has not done or failed to do anything that would justify the termination of her employment and that the termination of her employment would be without just and constitutional cause; and
WHEREAS the very real possibility exists that, within the near future, the position that EMPLOYEE has with EMPLOYER will have to be eliminated due to changes in the operational and employment needs of EMPLOYER, which will result in the termination of EMPLOYEE'S employment without regard to her job performance or lack of the same:
APPEARERS HAVE AGREED that the JACKSON PARISH POLICE JURY will terminate EMPLOYEE'S *509 employment effective IMMEDIATELY based upon its need to eliminate the position in which she is presently employed and will not oppose EMPLOYEE's efforts to obtain unemployment benefits as the result of her termination by alleging that said termination was for cause in exchange for which agreement MRS. YOSHI CHAMBERS THOMPSON agrees that she does, by these presents, hereby agree not to file legal proceedings of any kind against the JACKSON PARISH POLICE JURY, its individual jurors or its employees alleging that the termination of her employment was for any reason prohibited by the laws or constitutions of the United States or the State of Louisiana.
APPEARER MRS. YOSHI CHAMBERS THOMPSON further acknowledges that her signature constitutes a waiver of certain of her legal rights, that she has been free to consult with an attorney prior to her signing this document, which was prepared by counsel for EMPLOYER, that she fully understands the consequences of this legal act and had obtained, prior to signing the same, such legal or other advice as she deems appropriate.
The JPPJ evidently informed the Louisiana Department of Labor (LDOL) that Ms. Thompson had been terminated because a reorganization terminated her position. Ms. Thompson subsequently received unemployment benefits. In March 1998, the JPPJ removed from its personnel policies the provision that requires the termination of any employee who does not appear for a drug test.
On December 14, 1998, Ms. Thompson filed a civil suit against the JPPJ and David McManus, the JPPJ president. She alleged that her termination was based upon her failure to attend the drug test and that her termination was a violation of her rights under the federal and state constitutions. She claimed that requiring her to undergo drug testing, in the absence of any allegations of wrongdoing on her part, amounted to an invasion of privacy. She also alleged that the JPPJ policy was illegal, that the JPPJ jurors were liable under 42 U.S.C. § 1983 because they acted under color of state law and that they failed to implement a reasonable drug testing policy. After answering the petition, the defendants filed exceptions of prescription and res judicata.
On January 17, 2002, the court held a hearing on these exceptions. The court rejected the exception of prescription, but granted the exception of res judicata, essentially finding that the parties entered into an agreement to settle all claims by the plaintiff regarding her termination. On February 4, 2002, the court signed a judgment granting the exception of res judicata and dismissing Ms. Thompson's lawsuit. Ms. Thompson now appeals.
Ms. Thompson claims that the trial court, erred in granting the defendant's exception of res judicata, because the decision was based upon an agreement for which there was no consideration. She also asserts that her consent to the agreement was vitiated by the actions of the defendants. In the alternative, the plaintiff argues that the trial court committed reversible error by dismissing claims asserted by the plaintiff which were not addressed in the agreement upon which the exception was based. Also in the alternative, she urges that the trial court committed reversible error by dismissing her claims without affording her an opportunity to amend her petition to remove the grounds upon which the exception had been granted.

LACK OF CONSIDERATION
Ms. Thompson argues that her agreement with the JPPJ is unenforceable because *510 she received nothing in exchange for her agreement not to sue. She asserts that the JPPJ was not empowered by statute to implement a random drug testing policy of employees in positions that are not safety or security sensitive. Thus, she contends that the JPPJ could not have terminated her for misconduct related to her employment and she would rightly have been entitled to unemployment benefits even in the absence of the compromise. The plaintiff claims that the compromise is unenforceable because she had nothing to gain by signing the agreement. This argument is without merit.
A transaction or compromise is an agreement between two or more persons, who, for preventing or putting an end to a lawsuit, adjust their differences by mutual consent, in the manner which they agree on, and which every one of them prefers to the hope of gaining, balanced by the danger of losing. La. C.C. art. 3071.
Transactions regulate only the differences which appear clearly to be comprehended in them by the intention of the parties, whether it be explained in a general or particular manner, unless it be the necessary consequence of what is expressed. They do not extend to differences which the parties never intended to include in them. The renunciation, which is made therein to all rights, claims and pretensions, extends only to what relates to the differences on which the transaction arises. La. C.C. art. 3073.
The purpose of a compromise is to prevent or put an end to litigation. The essential elements of a compromise are: (1) mutual intention of putting an end to the litigation and (2) reciprocal concessions of the parties in adjustment of their differences. Rivett v. State Farm Fire and Casualty Company, 508 So.2d 1356 (La. 1987).
Public policy favors compromises and the finality of settlements. Brown v. Drillers, Inc., 93-1019 (La.1/14/94), 630 So.2d 741. The law strongly favors compromise agreements between parties, and the law will not invalidate such settlements absent a strong showing that they violate good morals or the public interest because of error, bad faith, or fraud. Alford v. Al Copeland Investments, Inc., 34,808 (La.App.2d Cir.6/20/01), 794 So.2d 52.
Transactions have, between the interested parties, a force equal to the authority of things adjudged. They cannot be attacked on account of any error in law or any lesion. But an error in calculation may always be corrected. La. C.C. art. 3078.
The facts of this case show that the compromise was a bilateral agreement. When the compromise was signed, the JPPJ was actively contesting Ms. Thompson's right to unemployment benefits on the grounds of misconduct for her failure to take the drug test. Even if the plaintiff might have ultimately been successful in receiving unemployment compensation benefits, she faced the expense of challenging the opposition of the JPPJ to her receipt of benefits. Whether or not she would ultimately be successful in her challenge is of no moment. The agreement was designed to put an end to the dispute. The JPPJ agreed to forego its opposition to the plaintiff's receipt of unemployment compensation benefits in exchange for the plaintiff's agreement to forego a lawsuit contesting her termination. Therefore, the plaintiff did receive consideration for her agreement.
The plaintiff cites Williams v. Winn Dixie, 447 So.2d 8 (La.App. 4th Cir.1984), in support of her argument that she received no consideration for the agreement. Williams is distinguishable from the present case. In Williams, a shopper was detained for several hours on suspicion of *511 shoplifting. While being detained, she signed an agreement releasing the store of all civil liability. The fourth circuit found that this was a unilateral release whereby she waived her claim without any consideration. The store argued that it gave up its right to prosecute the plaintiff for shoplifting; however, the written agreement between the parties failed to recite any consideration on the part of the store. Further, the court noted that the agreement was signed while the plaintiff was being held against her will. The compromise was held unenforceable because the agreement was not proven to be bilateral.
In the present case, the agreement states that, in exchange for the plaintiff's agreement not to contest the legality of her termination, the JPPJ would not oppose her efforts to receive unemployment compensation benefits. Specific consideration was set forth in the agreement. After the compromise, the JPPJ abided by the terms of the agreement and did not contest Ms. Thompson's right to unemployment benefits. Her termination was explained as the result of a reorganization. The conclusion of the dispute over the unemployment benefitseven if Ms. Thompson arguably would have prevailed at the end of the disputeis sufficient consideration to support the agreement.

LACK OF CONSENT
Ms. Thompson argues that her consent to the agreement was vitiated when the JPPJ did not eliminate her position, but instead simply added duties to her job. This argument is without merit.
A valid obligation requires, among other factors, consent. Consent may be vitiated by error, fraud, or duress. La. C.C. art.1948; Shreveport Great Empire Broadcasting, Inc. v. Chicoine, 528 So.2d 633 (La.App. 2d Cir.1988).
Error vitiates consent only when it concerns a cause without which the obligation would not have been incurred and that cause was known or should have been known to the other party. La. C.C. art. 1949. Error as to a subsidiary motive has no effect on the validity of the contract. Shreveport Great Empire Broadcasting, Inc. v. Chicoine, supra. Error may concern a cause when it bears on the nature of the contract, or the thing that is the contractual object or a substantial quality of that thing, or the person or the qualities of the other party, or the law, or any other circumstance that the parties regarded, or should in good faith have regarded, as a cause of the obligation. La. C.C. art.1950.
The agreement did not specifically state that the position would be eliminated. It merely indicated that the parties contemplated only that the "very real possibility exists that, within the near future, the position that EMPLOYEE has with EMPLOYER will have to be eliminated due to changes in the operational and employment needs of EMPLOYER ..."
The plaintiff has failed to show that the reorganization or elimination of her job was a principal cause of the agreement. There is also no showing that the JPPJ knew or should have known that this was the principal cause for the plaintiff signing the agreement. The JPPJ contends that the plaintiff's husband suggested the settlement because the plaintiff was having financial difficulty and needed to draw unemployment benefits. The benefit to Ms. Thompson as a result of the compromise was the termination of the dispute regarding her right to receive unemployment benefits. See and compare Shreveport Great Empire Broadcasting Inc. v. Chicoine, supra; Greater East Baton Rouge KOA, Inc. v. Lamar Corporation, 481 So.2d 654 (La.App. 1st Cir.1985); Marcello v. Bussiere, 284 So.2d 892 (La.1973).
*512 Because the reorganization was not a principal cause of the agreement, there was no error sufficient to vitiate the plaintiff's consent. We further reject any suggestion that her consent was induced by fraud as there was essentially no evidence to support such an allegation.

REMAINING CLAIMS
In the alternative, the plaintiff argues that the trial court erred in dismissing her claims that were the basis of the compromise but which were not addressed in the agreement. This argument is without merit.
Regarding the exception of res judicata, La. R.S. 13:4231 provides:
Except as otherwise provided by law, a valid and final judgment is conclusive between the same parties, except on appeal or other direct review, to the following extent:
(1) If the judgment is in favor of the plaintiff, all causes of action existing at the time of final judgment arising out of the transaction or occurrence that is the subject matter of the litigation are extinguished and merged in the judgment.
(2) If the judgment is in favor of the defendant, all causes of action existing at the time of final judgment arising out of the transaction or occurrence that is the subject matter of the litigation are extinguished and the judgment bars a subsequent action on those causes of action.
(3) A judgment in favor of either the plaintiff or the defendant is conclusive, in any subsequent action between them, with respect to any issue actually litigated and determined if its determination was essential to that judgment.
La. R.S. 13:4232 provides in pertinent part:
A. A judgment does not bar another action by the plaintiff:
(1) When exceptional circumstances justify relief from the res judicata effect of the judgment;
(2) When the judgment dismissed the first action without prejudice; or,
(3) When the judgment reserved the right of the plaintiff to bring another action.
The standard of review of a ruling on an exception of res judicata is manifest error when the exception is raised before the case is submitted and evidence is received from both sides. Medicus v. Scott, 32,326 (La.App.2d Cir.9/22/99), 744 So.2d 192.
In the present case, the agreement provided that the plaintiff would not ... file legal proceedings of any kind against the JACKSON PARISH POLICE JURY, its individual jurors or its employees alleging that the termination of her employment was for any reason prohibited by the laws or constitutions of the United States or the State of Louisiana.
Louisiana's doctrine of res judicata was based upon a presumption of correctness rather than an extinguishment of a cause of action. A decided case precluded a second suit only if it involved the same parties, the same cause, and the same object of demand as the prior suit. Under La. R.S. 13:4231, as amended in 1991, a second action could be barred because it arises out of the occurrence which was the subject matter of the prior litigation.
The central inquiry is not whether the second action is based on the same cause of action, but whether the second action asserts a cause of action which arises out of the transaction or occurrence which was the subject matter of the first action. Tate v. Prewitt, 33,895 (La.App.2d *513 Cir.9/27/00), 769 So.2d 800, writ denied, XXXX-XXXX (La.1/26/01), 781 So.2d 1265; McNichols Company v. Underwood, 2001 1323 (La.App. 3d Cir.3/6/02), ___ So.2d ___, 2002 WL 356249.
A plaintiff must assert all of his rights and claim all of his remedies arising out of the transaction or occurrence. Alternatively, he must reserve the right to bring another action. Atwell v. National Safety Consultants, Inc., XXXX-XXXX (La.App. 3d Cir.4/1/98), 713 So.2d 495, writ denied, XXXX-XXXX (La.10/30/98), 727 So.2d 1164. The failure to raise a claim that arises from the transaction or occurrence amounts to a waiver of that claim. Medicus v. Scott, supra.
The plaintiff's petition complaining of her termination from employment by the JPPJ alleged that the termination was a violation of her rights under the constitution and statutes of the state and federal governments. She contended that the JPPJ was not permitted by law to require her to undergo random drug testing. She claimed that the JPPJ was liable under 42 U.S.C. § 1983 because it acted under color of state law. She also maintained that the drug testing policy was unreasonable. All these claims are covered by the terms of her agreement with the JPPJ.
The claims are closely related and the plaintiff did not reserve her right in the agreement to object to the drug testing procedure. The nexus for all of her claims was her termination from employment and whether that termination was legally permissible. None of her claims fall outside the penumbra of the agreement. All claims arising from this transaction or occurrence were compromised by the agreement. Therefore, her claims are all barred by res judicata. The trial court did not err in this regard. See and compare Landrum v. Board of Commissioners of the Orleans Levee District, 95-1591 (La. App. 4th Cir.11/27/96), 685 So.2d 382.

AMENDMENT OF PLEADINGS
Also in the alternative, the plaintiff argues that the trial court erred in failing to allow her to amend her petition to remove the grounds for the exception of res judicata. This argument is without merit.
The exception of res judicata is a peremptory exception under La. C.C.P. art. 927. La. C.C.P. art. 934 provides that, when the grounds of the objection pleaded by the peremptory exception may be removed by amendment of the petition, the judgment sustaining the exception shall order such amendment within the delay provided by the court.
If the grounds of the objection cannot be so removed, or if the plaintiff fails to comply with the order to amend, the action shall be dismissed. Comments to La. C.C.P. art. 934 state that, "Though it is contemplated that in most instances the maintaining of the peremptory exception will necessarily result in a judgment dismissing the action, this article authorizes the trial judge to permit amendment of the petition whenever possible and whenever dismissal of the suit would not be in the interests of justice."
The decision to allow amendment of the pleading is within the discretion of the trial court. Broussard v. F.A. Richard & Associates, Inc., 1999-10 (La. App. 3d Cir.5/5/99), 740 So.2d 156, writ denied, XXXX-XXXX (La.6/4/99), 744 So.2d 625. The plaintiff has failed to show that she could amend her petition in such a way as to cure the exception of res judicata. The trial court did not abuse its discretion in declining to allow amendment of the pleadings.


*514 CONCLUSION
For the reasons expressed above, the judgment of the district court is affirmed. Costs of this appeal are assessed to the plaintiff, Yoshi Chambers Thompson.
AFFIRMED.
