2572. Deviation or delay in prosecuting the voyage is excused where authorized by the contract or necessary in order to comply with an express or implied warranty or where caused by circumstances beyond the control of the master and his employer or necessary for the safety of the insured property.
Deviation or delay is also excused where it occurs for the purpose of saving human life or aiding a ship in distress where human life may be in danger or where necessary for the purpose of obtaining medical or surgical aid for any person on board the ship, or where caused by the barratrous conduct of the master or crew, provided barratry is one of the perils insured against.