function internalError(errorMessage) {
    const prefixedMessage = `[p5.strands internal error]: ${errorMessage}`; 
    throw new Error(prefixedMessage);
}

function userError(errorType, errorMessage) {
    const prefixedMessage = `[p5.strands ${errorType}]: ${errorMessage}`;
    throw new Error(prefixedMessage);
}

function dimensionMismatchError(declaredDim,actualDim,varName){
    userError(
        'dimension mismatch',
    `Cannot assign a value of dimension ${actualDim} to \`${varName}\`, which expects dimension ${declaredDim}.`
    );
}

export { dimensionMismatchError, internalError, userError };
